Hi Giff,

I want to have a look at this for you, but you'll need to put the file on your server as plain-text because your server is parsing the PHP code and only sending us the output, not the source code.

Append *.txt to your file on the server and we should be able to see it better!


On 27 October2009, at 12:48, Giff Hammar wrote:

I started having trouble with a DBI interface to my PostgreSQL database after I built a new Ubuntu machine. The Postgres version is 8.3 and the
DBI was written several years ago (by someone else). I'm using PHP
version 5.2.6-3ubuntu4.2 with apache2. The problem is that I get the

Warning: pg_num_rows(): supplied argument is not a valid PostgreSQL
result resource in /var/www/lib/dbi_pgsql.php on line 202

I don't know what to check next to figure out why this is happening.
Here is what I have done so far:

- Updated the old PHP commands in the dbi file to reflect new ones
   var -> public
   pg_numrows -> pg_num_rows
   pg_cmdtuples -> pg_affected_rows
   pg_exec -> pg_execute
- Connected to the database as the same user by using straight PHP calls
 vs the DBI. It worked fine.
- Connected to the database via psql and that worked fine, too.

There is something with the DBI class that is not right, but I am a
novice with objects and classes, so I can't pin it down. The whole file
is here: http://www.sv-phoenix.com/dbi_pgsql.php - it's 205 lines so I
didn't want to put the whole thing in this post.

If anyone can take a look at it and let me know what to check next, I
would really appreciate it.


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

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

Reply via email to