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 SLP_products p LEFT JOIN SLP_products__pictures i ON p.default_' at line 3 SQL query : SELECT p.categoryID, p.useID, p.productURL, p.productID, p.name, i.icon, FROM SLP_products p LEFT JOIN SLP_products__pictures i ON p.default_picture = i.photoID LEFT JOIN SLP_catalog__type t ON p.categoryID = t.categoryID WHERE i.icon IS NOT NULL AND p.enabled=1 ORDER BY date_modified DESC LIMIT 3