<?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";
}
?>