Query Error SELECT record_id as id,alias,status,category_alias,category_id,accessories , name ,summary_auto, image, price,price_old,discount,types,manufactory_image,manufactory_name,manufactory_alias,published_double,warranty ,image_double,summary,is_hotdeal,style_types,is_new,promotion_price,gift ,if(price > 0,price, 9999999999) as price_new FROM fs_products_test AS a WHERE published = 1 AND ( cong_dung like '%,102,%' ) AND ( manufactory_id_wrapper like'%,8,%' OR manufactory_id_wrapper like'%,23,%' OR manufactory_id_wrapper like'%,28,%' OR manufactory_id_wrapper like'%,40,%' OR manufactory_id_wrapper like'%,51,%' OR manufactory_id_wrapper like'%,64,%' ) AND ( ( CONVERT( a.price, DECIMAL(10,2)) >= 1000000 AND CONVERT( a.price, DECIMAL(10,2)) <= 3000000 ) ) AND ( CONVERT( a.rate, DECIMAL(10,2)) >= 4.5 OR ( CONVERT( a.rate, DECIMAL(10,2)) >= AND CONVERT( a.rate, DECIMAL(10,2)) < 1.5 ) ) AND category_id_wrapper like "%,74,%" ORDER BY ordering DESC, id DESC LIMIT 0,20
Array ( [0] => 42000 [1] => 1064 [2] => 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 CONVERT( a.rate, DECIMAL(10,2)) < 1.5 ) ) AND category_id_wrapper like "%,7' at line 2 )