//connection
$table = "firstPage";
$conn_string = "host=/var/run/postgresql dbname=prao user=www-prao";
$db = pg_connect($conn_string);
if($db) {
$query = "SELECT * FROM $table WHERE nameDiv='News' ORDER BY number ASC";
$result = pg_exec($db, $query);
$numb = pg_numrows($result);
$rowFromTable = pg_fetch_array($result);
//print " numb = $numb
";
} else {
print "Can't create connection
";
exit;
}
?>