Jake Bunce
Wed 6th Feb '02, 12:13am
i took the following code in a script and moved it into it's own function at the top of the script and then put "getmembers();" (the name of the function) in the place where the code used to be and it gave me the following error: Fatal error: Call to a member function on a non-object in /home/jake/public_html/forum/clan.php on line 15 . line 15 is the first line in the new function, starting with $users = $DB_site->query(".
$users = $DB_site->query("
SELECT DISTINCT
user.*, userfield.*, session.userid AS sessionuserid, session.lastactivity
FROM user
LEFT JOIN usergroup ON (usergroup.usergroupid = user.usergroupid)
LEFT JOIN userfield ON (userfield.userid = user.userid)
LEFT JOIN session ON (session.userid = user.userid
AND session.userid <> 0 AND user.invisible = 0 AND session.lastactivity>0)
WHERE user.usergroupid IN($clan_usergroup,$admin_usergroup,$supermod_user group,$mod_usergroup)
GROUP BY user.username
ORDER BY user.username
");
while ($user = $DB_site->fetch_array($users)) {
if ($user[usergroupid] == $clan_usergroup || $admin_usergroup || $supermod_usergroup || $mod_usergroup) {
if (($clancount++ % 2) == 0) $backcolor = "{secondaltcolor}";
else $backcolor = "{firstaltcolor}";
douserinfo();
eval("\$clanbits .= \"".gettemplate("clanbits")."\";");
}
}
unset($user);
any ideas? what is a non-object and a member function?
$users = $DB_site->query("
SELECT DISTINCT
user.*, userfield.*, session.userid AS sessionuserid, session.lastactivity
FROM user
LEFT JOIN usergroup ON (usergroup.usergroupid = user.usergroupid)
LEFT JOIN userfield ON (userfield.userid = user.userid)
LEFT JOIN session ON (session.userid = user.userid
AND session.userid <> 0 AND user.invisible = 0 AND session.lastactivity>0)
WHERE user.usergroupid IN($clan_usergroup,$admin_usergroup,$supermod_user group,$mod_usergroup)
GROUP BY user.username
ORDER BY user.username
");
while ($user = $DB_site->fetch_array($users)) {
if ($user[usergroupid] == $clan_usergroup || $admin_usergroup || $supermod_usergroup || $mod_usergroup) {
if (($clancount++ % 2) == 0) $backcolor = "{secondaltcolor}";
else $backcolor = "{firstaltcolor}";
douserinfo();
eval("\$clanbits .= \"".gettemplate("clanbits")."\";");
}
}
unset($user);
any ideas? what is a non-object and a member function?