PostgreSQL connection problems

admin

Administrator
Staff member
I am trying to connect to a PostgreSQL database using PHP, I have tried the following test script.........

<?php
$dbconn = pg_Connect("host=localhost" "dbname=post_test" "user=postgres" "passwd=password123");
print ("Connected successfully");
pg_close ($dbconn);
?>

but get the following error.........

Parse error: parse error in /usr/local/apache/htdocs/test.php on line 2

I have had a fair amount of success using MySQL so I assume I have Apache and PHP are installed OK.

I can connect, no problem from the command line and the Postmaster was started using $postmaster -i.

Could it be something to do with the $PATH (only user postgres has the data and libraries in its path)? or am I doing something fundamentaly wrong?

Any other pitfals I need be aware of when porting from MySQL to postgres?

Muchos gracias

Stew:80
 
Back
Top