Seems to work good.
Just don't delete ratings of deleted users when you don't have any deleted users who made ratings, because then you will encounter this database error:
Quote:
Invalid SQL:
SELECT *, s.name, u.username, !(BIT_OR(ug.radiotvpermissions) & 64) as candomagic
FROM radiostation_rating AS r
LEFT JOIN user AS u ON (u.userid = r.userid)
LEFT JOIN usergroup AS ug ON (find_in_set(ug.usergroupid, u.membergroupids) OR (ug.usergroupid = u.usergroupid))
LEFT JOIN radiostation AS s ON (s.stationid = r.stationid)
WHERE r.userid IN ()
GROUP BY r.ratingid
HAVING candomagic > 0;
MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
GROUP BY r.ratingid
HAVING candomagic > 0' at line 6
Error Number : 1064
Request Date : Tuesday, March 27th 2012 @ 07:39:59 PM
Error Date : Tuesday, March 27th 2012 @ 07:40:00 PM
Script : http://www.mydomain.com/forum/adminc...o=cleanratings
Referrer : http://www.mydomain.com/forum/adminc...php?do=cleanup
IP Address : 84.26.xx.xx
Username : Black Tiger
Classname : vB_Database
MySQL Version : 5.0.95-community
|