#25003 [Asn]: DB bums out with a "Call to member function on a non-object"

From: Date: Mon, 18 Aug 2003 12:09:49 +0000
Subject: #25003 [Asn]: DB bums out with a "Call to member function on a non-object"
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-19971@lists.php.net to get a copy of this message
ID: 25003 Updated by: nicos@php.net Reported By: gildseth at start dot no Status: Assigned Bug Type: PEAR related Operating System: Linux PHP Version: 4.3.1 Assigned To: cox New Comment: It looks we verify if the query is fine with DB::isError. and it looks a big problem with isError, it looks we thought it returns true on error but in fact it returns false... Need feedback from cox/ssb please. Previous Comments: ------------------------------------------------------------------------ [2003-08-10 13:32:40] gildseth at start dot no An example which triggers the bug: <?PHP define('DB_CONNECT_STR', 'mysql://username:password@hostname/database'); require_once('DB.php'); $pearDB = DB::connect(DB_CONNECT_STR); $pearDB->getAll('DELETE FROM test WHERE id=4'); /* CREATE TABLE test (id int(11) default NULL); INSERT INTO test VALUES(4); */ ?> ------------------------------------------------------------------------ [2003-08-10 10:44:05] gildseth at start dot no Description: ------------ I accidentally passed a DELETE query to DB::getAll, and DB fell over: Fatal error: Call to a member function on a non-object in /usr/local/lib/php/DB/common.php on line 1166 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25003&edit=1

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