Re: Function misfunction - 2

From: Date: Tue, 31 Dec 2002 12:56:16 +0000
Subject: Re: Function misfunction - 2
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-129767@lists.php.net to get a copy of this message
On Tuesday 31 December 2002 20:48, Martin S wrote: > This is the function which should return e.g. "printers" for $lookuptable. > But doesn't. > > function setCurrentDevGroup($devID) > { > global $adb; > $query = "SELECT dev_group FROM tracking WHERE (computer = > $devID)"; $sth = $adb->prepare($query); > if($sth) > { > $res = $sth->execute(); > $resulttable = $sth->fetchrow_hash(); > $lookuptable = $resulttable["dev_group"]; > // DEBUG > echo $lookuptable; // this give the correct value So here $lookuptable contains the correct value (eg "printers") ?? > } > return $lookuptable; > } But something like: echo setCurrentDevGroup($devID); gives the wrong/no value? If so, could you show how you are using this function in your code? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* The whole world is a tuxedo and you are a pair of brown shoes. -- George Gobel */

« previous php.general (#129767) next »