SELECT filename FROM series2 AS s JOIN series_language2 AS sl ON sl.category_id = s.category_id WHERE sl.language_id = AND s.series_id = 7 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 'AND s.series_id = 7' at line 1