ayaniimi213
7/11/2013 - 10:51 PM

PHPSample.php

<?php
$db = pg_connect('host=localhost user=pgsql dbname=auction');

if(!$db) {
  die('cannot connect');
}

$sql = "select * from users;";
$result = pg_query($db, $sql);

if(!$result) {
	die('cannot execute query');
}

while ($row = pg_fetch_assoc($result)){
	echo $row['userid']." ".$row['name']." ".$row['rating']."\n";
}

?>