Re: DB_common escapeSimple() not found

From: Date: Fri, 04 Nov 2005 02:08:41 +0000
Subject: Re: DB_common escapeSimple() not found
References: 1 2 3 4 5 6  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21770@lists.php.net to get a copy of this message
The error msg is "Fatal error: Call to undefined function: escapesimple() in /usr/local/php/lib/php/DB/common.php on line 434" Steps to reproduce: script has these includes: require_once "${_SERVER['DOCUMENT_ROOT']}/includes/php/get_dbi.php"; require_once "${_SERVER['DOCUMENT_ROOT']}/includes/php/MyClass.php"; get_dbi.php gets a DB connection and has: require('DB.php'); inside MyClass: DB_common::quoteSmart($some_string); I get the same error if i add require_once('DB.php') to MyClass. Can anyone verify this or suggest why this could be happening?
Well no *wonder* it's happening. $this is used in quoteSmart(). It *has* to be called on an instance. You can't call it statically. $db = DB::connect($dsn); $sql = 'SELECT * FROM table WHERE col='.$db->quoteSmart($value); -- Justin Patrin
GAH!! What a junior mistake! I knew it had to be something ridiculous but holy smoke... Thanks a million Justin! brian

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