Invalid query: SELECT FROM catalog_goods tG, catalog_categories tC, catalog_categories tC2 WHERE tG.visibility = 1 AND tC.id = tG.pid AND tG.width = "305" AND tG.height = "40" AND tG.radius = "22" AND tC2.pid = 1 AND tC.pid = tC2.id AND tC.visibility = 1 AND tC2.visibility = 1 AND tG.price > 0 AND tG.availability > 0 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 'FROM catalog_goods tG, catalog_categories tC, catalog_categories tC2 WHERE tG.vi' at line 1