I’m trying to connect to a postgres database using the code below but it doesn’t seem to work.
<?php echo 'point 0'; $con = pg_Connect("dbname=testdb port=5432 user=postgres"); if ($con == 0) { die ("Could not connect"); } echo 'point 1
'; ?>
and all that shows up in my web browser is
point 0
Shoudn’t it at least be telling me that it ‘Could not connect’? What does this mean?
I’ve got my database in usr/local/pgsql/data, my username is ‘postgres’ and I don’t have a password, and I’m running my php file out of localhost (usr/local/apache2/htdocs). help!
Gibran