Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND unique_no = 118' at line 1 Whole query: SELECT name FROM show_judges WHERE season_no = 4 AND show_no = AND unique_no = 118