RE: [PEAR] getOne problem - still no solution

From: Date: Mon, 03 Mar 2003 22:35:26 +0000
Subject: RE: [PEAR] getOne problem - still no solution
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-4033@lists.php.net to get a copy of this message
The same PHP error happens if I do a query() command that returns an empty result set; but oddly enoug fetchRow() works fine. All of the other pear functions seem to work okay; other then these two which return an error if an empty set is returned. (I expected NULL returned as you received, but no luck). I was glad to see that someone else posted on the list that they too received issues with pear with their empty queries, but thought that it was part of the pear system -- which I assume it isn't. My system specs are: php 4.2.3, mysql 3.23.54, pear DB.php,v 1.86.2.2. -----Original Message----- From: Lukas Smith [mailto:smith@backendmedia.com] Sent: Monday, March 03, 2003 2:25 PM To: 'Gigabyte'; pear-general@lists.php.net Subject: AW: [PEAR] getOne problem - still no solution > Von: Gigabyte [mailto:gigabyte@superdudes.net] > Gesendet: Montag, 3. März 2003 21:43 > An: pear-general@lists.php.net > Betreff: [PEAR] getOne problem - still no solution > > I'm still hunting for a solution to my getOne issue... > Any takers? > > ------- > > I seem to be having issues with getOne. > $dbh->getOne("select id from login where name='bob'"); > > If I send an sql query that returns an Empty Set, it comes back with the > following error: > PHP Fatal error: Call to a member function on a non-object in > xxx.class on line 15 > > > This is the same query run from the mysql command line: > mysql> SELECT id from login where name = 'bob'; > Empty set (0.00 sec) I tried to reproduce your issues. If I use getOne with PEAR DB on a query that returns an empty set I get php NULL returned which is what should happen. So could you post some more code? Also does PEAR DB otherwise work for you? Do other queries work? Is there anything in your setup that might be out of the ordinary: like old php/mysql/pear db version? Regards, Lukas -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.pear.general (#4033) next »