Re: pg_prepare()/pg_execute() and pg_query_params()

From: Date: Wed, 27 May 2009 14:30:18 +0000
Subject: Re: pg_prepare()/pg_execute() and pg_query_params()
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-46205@lists.php.net to get a copy of this message
d == danaketh@gmail.com writes: d> Then you should put some debugging around the connection code. d> |$pgconn = pg_connect("host=localhost port=5432 dbname=test user=test d> password=test")| or die("Problem with connection to PostgreSQL: d> ".pg_last_error()); d> So you can be sure that you are really connected. Also you can use d> pg_result_error()... d> $result = pg_query_params($pgconn, $update, array($foo, $bar)); d> echo pg_result_error($result); d> or even pg_result_error_field(). I did have error checking around the call to pg_connect(). My problem was twofold. One, I had a typo in the connection string and two, I wasn't properly passing the error message back to top level application, so I wasn't seeing the error from pg_connect(). Stupid mistake. -- Brandon

« previous php.db (#46205) next »