I am trying to update this cleanup to instead of
UPDATE users SET enabled = 'no'
I use
UPDATE users SET limited = 'yes'
And refuses to update column no matter what I throw at it. I put this same query on index.php and it works without a hitch.
This field type is ENUM DEFAULT 'no'
I can't figure it out. Maybe someone has an idea of the voodoo going on here, rarely do I have these issues and usually have success on first attempt.
Logs and Shoutbox show nothing reflecting the code block above, nor does the table. As soon as I revert changes, immediately its banning people again (2500+). :mad:
UPDATE users SET enabled = 'no'
I use
UPDATE users SET limited = 'yes'
And refuses to update column no matter what I throw at it. I put this same query on index.php and it works without a hitch.
This field type is ENUM DEFAULT 'no'
// Limit warned users
$res = SQL_Query_exec("SELECT users.id, users.username, UNIX_TIMESTAMP(warnings.expiry) AS expiry FROM users INNER JOIN warnings ON users.id=warnings.userid WHERE type='Poor Ratio' AND active = 'yes' AND account_limited = 'no' AND class = 1 AND enabled='yes' AND warned = 'yes' AND uploaded / downloaded < $minratio AND downloaded >= $downloaded");
if (mysql_num_rows($res) > 0) {
$timenow = get_date_time();
$expires = (86400 * $length);
while ($arr = mysql_fetch_assoc($res)) {
if (gmtime() - $arr["expiry"] >= 0) {
// Send to Shoutbox - Low Ratio user limited
$limiteduser = $arr["username"];
$event = $arr["username"] . " has been limited (Auto Leech warning).";
SQL_Query_exec("INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, '$limiteduser', '$event', NOW(), 0)");
SQL_Query_exec("UPDATE users SET account_limited = 'yes', warned = 'no' WHERE id='" . $arr["id"] . "'");
write_log("User <a href='/user/?id=" . $arr["id"] . "'>" . $arr["username"] . "</a> has been <b>limited</b> (Auto Leech warning).");
}
}
}
I can't figure it out. Maybe someone has an idea of the voodoo going on here, rarely do I have these issues and usually have success on first attempt.
Logs and Shoutbox show nothing reflecting the code block above, nor does the table. As soon as I revert changes, immediately its banning people again (2500+). :mad:
