Could not query: 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 '1' at line 1

SQL:
select t1.id, t1.productname, t1.slogan, t1.market_price, t1.price, t1.buy_flag, t1.category_id, IF(t1.score_mod = 1, (select AVG(t3.score) from score as t3 where t3.product_id = t2.id), t1.score_set) as score, IF(t1.score_mod = 1, (select COUNT(t4.score) from score as t4 where t4.product_id = t2.id), 1) as score_num, t5.name,t6.name from buy_product as t1 left join category_buy as t6 on t1.category_id = t6.id left join product as t2 on t1.product_id = t2.id left join category_buy as t5 on t1.category_id = t5.id where t1.num > 0 and (t1.online_time = 0 or t1.online_time < now()) and t1.category_id=33 and (t1.offline_time = 0 or t1.offline_time > now()) order by t5.sequence desc, t5.id asc, t1.sequence desc, t1.id desc limit ,1