$user = $DB_site->query_first(" SELECT userid, username, avatarrevision FROM " . TABLE_PREFIX . "user WHERE userid = $userid "); $DB_site->query(" UPDATE " . TABLE_PREFIX . "post SET username = '" . addslashes($user['username']) . "', userid = 0 WHERE userid = $userid "); $DB_site->query(" UPDATE " . TABLE_PREFIX . "usernote SET username = '" . addslashes($user['username']) . "', posterid = 0 WHERE posterid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "usernote WHERE userid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "user WHERE userid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "userfield WHERE userid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "usertextfield WHERE userid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "access WHERE userid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "event WHERE userid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "customavatar WHERE userid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "customprofilepic WHERE userid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "moderator WHERE userid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "subscribeforum WHERE userid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "subscribethread WHERE userid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "subscriptionlog WHERE userid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "session WHERE userid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "userban WHERE userid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "administrator WHERE userid = $userid "); $DB_site->query(" DELETE FROM " . TABLE_PREFIX . "usergrouprequest WHERE userid = $userid "); $DB_site->query("DELETE FROM " . TABLE_PREFIX . "pmreceipt WHERE userid = $userid"); $DB_site->query("DELETE FROM " . TABLE_PREFIX . "pm WHERE userid = $userid");