SELECT p.product_id,p.name,p.nameEng,p.urlName,p.description,p.brutto,p.przecena,p.sex,p.quantity,pr.name as producent_name,pf.fileName,pf.description as file_description,pf.url FROM (sklep_new_products p, sklep_new_producents pr, sklep_new_products_to_category ptc, sklep_new_menu m) LEFT JOIN sklep_new_productsFile pf ON (p.product_id=pf.product_id AND file_type='pikto') WHERE p.producent_id=pr.producent_id AND p.status=1 and p.product_id=ptc.product_id AND m.menu_id=ptc.category_id AND m.menu_id=232 AND( p.sex=all OR p.sex=0) AND p.quantity > 0 GROUP BY p.product_id ORDER BY p.insertDate DESC LIMIT 0,36
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 'OR p.sex=0) AND p.quantity > 0 GROUP BY p.product_id ORDER BY p.ins' at line 9