I am trying to connect to PostgreSQL7.13 from PHP 4.06 in Linux 7.2 .
And I wrote code like this ,
<?php
$con = pg_connect("","","foo");
if ($con == false) {
print("Can't connect");
exit;
}
$sql = "SELECT day , wether FROM report ORDER BY day";
$result = pg_exec($sql);
if ($result == false) {
printf("SQL:fail to execute \"$sql\"");
exit;
}
?>
but I can get message from php like
Warning: Unable to connect to PostgreSQL server: FATAL 1: user "apache" does not exist in /home/httpd/html/dadada.php on line 6
does anybody can help ?
thanks in advance