Jason Wong wrote:
> On Tuesday 31 December 2002 20:02, Martin S wrote:
>> Marek Kilimajer wrote:
>> > You forgot global $adb; at the beginning of your function, or use
>> >
>> > $sth = $GLOBALS['adb']->prepare($query);
>>
>> Nope sorry, I've just edited it from my post here. It is in the function.
>
> Hmm, whenever you post code to the list you should *always* (where
> possible) copy and paste. If the code that you post is different to that
> which you are actually running then it makes it difficult for people to
> help you.
>
> So if you can, could you please post your complete unadulterated code?
>
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
}
return $lookuptable;
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php