1
function remUser($uid) {
$sql = 'SELECT * FROM '.$xoopsDB->prefix('groups_users_link').' WHERE `groupid` = "'.XOOPS_GROUP_SUBSCRIBERS.'" AND uid = "'.$uid.'"';
$result = $xoopsDB->query($sql);
$rows = $xoopsDB->getRowsNum($result);
if ($rows > 0) {
$sql = 'DELETE FROM '.$xoopsDB->prefix('groups_users_link').' WHERE `groupid` = '.XOOPS_GROUP_SUBSCRIBERS.' AND `uid` = '.$uid;
if (!$xoopsDB->queryF($sql)) {
return false;
}
return true;
}
return true;
}
This is my code for a function I'm writing. XOOPS_GROUP_SUBSCRIBERS is defined in mainfile.php, and all of that is included appropriately. This function works fine if I don't use it as a function (i.e. I put the code in where I'm calling the function), so I'm at a loss as to why it won't let me make it a function. Is it something to do with $xoopsDB? Thanks in advance for your help!