MySQL Error #1064 : 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 '' at line 1(Query was: SELECT th.nom, th.url FROM theme AS th INNER JOIN theme_photo AS thp ON th.themeID = thp.themeID WHERE thp.photoID = )