SELECT DISTINCT
count(s.remix_id)
FROM
remix s, remix_anime ra, anime a, anime_title_a ata, remix_remixer x, remixer r
WHERE
s.remix_id = ra.remix_id AND
ra.remix_anime_id=ra.remix_anime_id AND
s.remix_archive = 0 AND
a.id=ra.anime_id AND
ata.id = a.title_id AND
x.remix_id = s.remix_id AND
x.remixer_id = r.remixer_id AND (
s.remix_name LIKE '%%' OR
s.remix_genre LIKE '%%' OR
ata.title LIKE '%%' OR
r.remixer_name LIKE '%%' OR
s.remix_date LIKE '%%') AND x.remixer_id= ORDER BY s.remix_date desc LIMIT 0 , 20You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY s.remix_date desc LIMIT 0 , 20' at line 17