PJ,

I remember the days when this stuff seemed beyond mystical.

1. $dbh and $query are not "built-in" variables... but they need to be defined somewhere earlier in the code. That could even be in a different file if the file you're in has been included.
2. One trick to try is to use the php function var_dump().

var_dump($dbh, $query);

That will spit out the contents of both of those variables so you can see what's "inside" them. If one or either of them spits out as NULL, then it is undefined. If you see FALSE, then there may have been an error connecting to the database.

~Ted



On 3-Jun-08, at 3:28 PM, PJ wrote:

I don't know if this is the right list, it seems php and postgresql are rather interdependent in the webside I am debugging :(, but here goes:

I'm getting this error:
pg_execute() [<a href='function.pg-execute'>function.pg-execute</ a>]: No array passed E_WARNING

for this line of code:
if( !($r=pg_execute($dbh, $query)) )

I suspect that I am not connecting to the database on the server...
How can I check my connection from withing the code or some other way?
Are the $dbh and $query built-in variables in postgres or php - I'm afraid that I'm rather a bumbling newbie :)

I can connect from XP to the FreeBSD 7.0 server and I can access and read the files and the samba connection appears to be correct... but I can't connect to the database from phped debugger
Can't figure this out...
Help ???

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to