Re: DataObject error notice when no results

From: Date: Sat, 25 Jan 2003 03:44:48 +0000
Subject: Re: DataObject error notice when no results
References: 1 2 3 4 5 6 7  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-12736@lists.php.net to get a copy of this message
Jeroen Houben wrote:
Hi Alan, the following code will result in a notice "Notice: Undefined variable: this in /usr/local/share/php/pear/DB/DataObject.php on line 1719" $subs = DataObjects_Meet_subscriptions::staticGet('eventID',10); But _only_ when there are no records in the DB with eventID=10. I added @ to the function is_object($this) on line 1719 to fix this, but I don't know if I'm doing something wrong in the first place are if this is really a small bug. Perhaps I shouldn't use staticGet when I don't know for sure that it will return rows (?). thanks - fixed in CVS. - the whole -did I get called statically in PHP4, question will hopefully be alot simpler in PHP5 :)
Regards Alan
Thanks Jeroen
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

« previous php.pear.dev (#12736) next »