therecluse26 / PHP-Login

A login system built with PHP, MySQL, jQuery and Bootstrap
MIT License
836 stars 442 forks source link

MySQL event for un-ban member does not work. #221

Open budiony opened 6 years ago

budiony commented 6 years ago

The reason is trivial: SQL error. The event unbanUsers should be:

BEGIN DELETE FROM member_jail WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(timestamp) - (banned_hours * 60*60)) > 0; UPDATE members m SET m.banned = 0 WHERE m.banned = 1 AND m.id NOT IN (SELECT v.user_id FROM member_jail v); END