Re: function misfunction

From: Date: Mon, 30 Dec 2002 14:35:59 +0000
Subject: Re: function misfunction
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-129669@lists.php.net to get a copy of this message
On Monday 30 December 2002 22:07, Michael Sims wrote: > On Mon, 30 Dec 2002 14:48:13 +0100, you wrote: > >function setCurrentDevGroup($devID) > > { > >// start original routine > > $query = "SELECT dev_group FROM tracking WHERE (computer = > > $devID)"; $sth = > > $adb->prepare($query); > > [...] > > > Call to a member function on a non-object in > >/www/htdocs/dev/include/irm.inc on line 2857 > > Just a guess, but where did $adb inside your function come from? It > doesn't appear that you've instantiated it. Specifically, if it's instantiated elsewhere in your code and it's in the global scope then you need to declare it as global within your function: function setCurrentDevGroup($devID) { global $adb; /// rest of function } -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Maybe we could paint GOLDIE HAWN a rich PRUSSIAN BLUE -- */

« previous php.general (#129669) next »