Error in executing SELECT DISTINCT(SI.`id`), SI.`label`, SI.`comment` FROM `product` PT, `size` SI WHERE PT.`productCatId` = AND PT.`size` = SI.`id` ORDER BY SI.`id` ASC stmterror: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 'AND PT.`size` = SI.`id` ORDER BY SI.`id` ASC' at line 1