Re: DB interface problem

From: Date: Wed, 28 Oct 2009 10:23:05 +0000
Subject: Re: DB interface problem
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-46596@lists.php.net to get a copy of this message
Why not using PDO ? It is a global and standardized method to access to data. :-) 2009/10/27 Giff Hammar <ghammar@sv-phoenix.com>: > 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 > error: > > 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. > > Giff > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.db (#46596) next »