PDA

View Full Version : Getting SQl/php error, help plz


Prophet2002
09-18-2002, 09:47 PM
This error is occuring when i try to mass prune users.

Database error in vBulletin Control Panel 2.2.7:

Invalid SQL: SELECT userid,username FROM user WHERE userid IN() LIMIT 0
mysql error: You have an error in your SQL syntax near ') LIMIT 0' at line 1

mysql error number: 1064

I tracked this query down in admin/user.php

......
$users = $DB_site->query("SELECT userid,username FROM user WHERE userid IN($userids) LIMIT $startat,50");
if ($DB_site->num_rows($users)) {
while ($user = $DB_site->fetch_array($users)) {
echo "<p>Updating threads and posts for user: <i>$user[username]</i> ....\n";
flush();
$DB_site->query("UPDATE thread SET postuserid=0, postusername='".addslashes($user[username])."' WHERE postuserid=$user[userid]");
$DB_site->query("UPDATE post SET userid=0, username='".addslashes($user[username])."' WHERE userid=$user[userid]");
echo "<b>done</b>.</p>\n";
flush();
.......

I do have alot of hack installed but i uploaded a fresh user.php and still getting the same error
I'm running MySQL 3.23.41 and php 4.2.2 anyone know whats goin on?

Xenon
09-19-2002, 09:50 AM
its a bug in vb2.2.7
http://www.vbulletin.com/forum/showthread.php?s=&threadid=53776
ther's how to fix

Prophet2002
09-19-2002, 02:20 PM
thx buddy