Takara
06-24-2002, 11:23 AM
Whenever I go to the admin CP, then to edit a user I get the following error message (it occours for every user, not just 'Takky'):
Database error in vBulletin Control Panel 2.2.5:
Invalid SQL: SELECT userid
FROM user
WHERE username='Takky'
AND userid <>
mysql error: You have an error in your SQL syntax near '' at line 4
mysql error number: 1064
Date: Monday 24th of June 2002 08:14:46 AM
Script: http://myforums/admin/user.php
Referer: http://myforums/admin/user.php?s=&action=edit&userid=15
This is the code around the area:
// ###################### Start do update #######################
if ($HTTP_POST_VARS['action']=="doupdate") {
if (!isset($ausername) or $ausername == '') {
echo "<p>You did not give this user an username</p>";
exit;
}
if ($exists=$DB_site->query_first("SELECT userid
FROM user
WHERE username='".addslashes(htmlspecialchars($ausername))."'
AND userid <> $userid")) {
echo "There is already an ".makelinkcode('user',"user.php?do=edit&userid=$exists[userid]",1)." named <b>".htmlspecialchars($ausername)."</b>";
exit;
}
// check that not removing last admin
$countadmin=$DB_site->query_first("SELECT COUNT(*) AS users FROM user,usergroup WHERE user.usergroupid=usergroup.usergroupid AND usergroup.cancontrolpanel=1 AND user.userid<>$userid");
$getperms=$DB_site->query_first("SELECT cancontrolpanel FROM usergroup WHERE usergroupid=$usergroupid");
if ($countadmin[users]==0 and $getperms[cancontrolpanel]!=1) {
echo "<p>You are about to edit the last user with control panel access so that they do not have control panel access. This would lock you out of the control panel, so you cannot proceed.</p></body></html>";
exit;
}
I hadnt done anything recently, except add log's thread subscribe hack.. but that edits showthread.php, not user.php
Can anyone give me a hand?
Database error in vBulletin Control Panel 2.2.5:
Invalid SQL: SELECT userid
FROM user
WHERE username='Takky'
AND userid <>
mysql error: You have an error in your SQL syntax near '' at line 4
mysql error number: 1064
Date: Monday 24th of June 2002 08:14:46 AM
Script: http://myforums/admin/user.php
Referer: http://myforums/admin/user.php?s=&action=edit&userid=15
This is the code around the area:
// ###################### Start do update #######################
if ($HTTP_POST_VARS['action']=="doupdate") {
if (!isset($ausername) or $ausername == '') {
echo "<p>You did not give this user an username</p>";
exit;
}
if ($exists=$DB_site->query_first("SELECT userid
FROM user
WHERE username='".addslashes(htmlspecialchars($ausername))."'
AND userid <> $userid")) {
echo "There is already an ".makelinkcode('user',"user.php?do=edit&userid=$exists[userid]",1)." named <b>".htmlspecialchars($ausername)."</b>";
exit;
}
// check that not removing last admin
$countadmin=$DB_site->query_first("SELECT COUNT(*) AS users FROM user,usergroup WHERE user.usergroupid=usergroup.usergroupid AND usergroup.cancontrolpanel=1 AND user.userid<>$userid");
$getperms=$DB_site->query_first("SELECT cancontrolpanel FROM usergroup WHERE usergroupid=$usergroupid");
if ($countadmin[users]==0 and $getperms[cancontrolpanel]!=1) {
echo "<p>You are about to edit the last user with control panel access so that they do not have control panel access. This would lock you out of the control panel, so you cannot proceed.</p></body></html>";
exit;
}
I hadnt done anything recently, except add log's thread subscribe hack.. but that edits showthread.php, not user.php
Can anyone give me a hand?