QUERY: SELECT u.id, ((SELECT COUNT(id) FROM timetable_logs WHERE dj = u.id OR dj_2 = u.id) + (SELECT COUNT(id) FROM timetable WHERE dj = u.id OR dj_2 = u.id)) as total_hours FROM (SELECT DISTINCT id FROM users WHERE rank = 'Deejay' OR rank_2 = 'Deejay' OR rank = 'DJ beheerder' OR rank_2 = 'DJ beheerder' OR rank = 'DJ beheerder in opleiding' OR rank_2 = 'DJ beheerder in opleiding') u ORDER BY `total_hours` DESC LIMIT 5
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 '= 'Deejay' OR rank_2 = 'Deejay' OR rank = 'DJ beheerder' OR rank_2 = 'DJ beheerd' at line 1