Re: DB error: $db->query('SELECT 1+1') called in function is thorwing error

From: Date: Fri, 19 Aug 2005 17:40:19 +0000
Subject: Re: DB error: $db->query('SELECT 1+1') called in function is thorwing error
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-20491@lists.php.net to get a copy of this message
On 8/19/05, l Burnerheimerton <lburnerheimerton@yahoo.com> wrote: > I have code that calls a function. In that function, > I have labored several hours trying to see WHY it's > throwing an error. I'd like a second, or third pair > of eyes to help. I have narrowed it down to its > essential, I think, a very simple example. > > The error is: > Fatal error: Call to a member function on a non-object > in C:\...\check.php line 34 > Are you perhaps....calling a member function on a non-object? Try print_r($db); I bet you get no output. Are you trying to access a global variable in a function? If so, use a singleton function or $GLOBALS['db']. -- Justin Patrin

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