Invalid Query: select i_thumbnail_path from images where i_p_id = and i_represented = 'y' Error is: 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 i_represented = 'y'' at line 1