SQL Ошибка для [SELECT p1.id as id1, p2.id as id2, 2583 as cid, 19 as kr FROM `phpshop_products` AS p1 INNER JOIN `phpshop_products` AS p2 ON p1.`autoschetki_brand`=p2.`autoschetki_brand` and p1.`autoschetki_krepl`=p2.`autoschetki_krepl` and p1.`autoschetki_tip_dvo`=p2.`autoschetki_tip_dvo` WHERE p1.`enabled` = '1' and p1.`autoschetki_enabled` = '0' and (p1.`autoschetki_size` between 75 and 75) and p1.`autoschetki_krepl` like '%;s:2:"19";%' AND p2.`enabled` = '1' and p2.`autoschetki_enabled` = '0' and (p2.`autoschetki_size` between and ) and p2.`autoschetki_krepl` like '%;s:2:"19";%' ORDER BY rand() LIMIT 15] 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 ) and p2.`autoschetki_krepl` like '%;s:2:"19";%' ORDER BY rand() LIMIT 15' at line 6