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 '-10,10' at line 1 in SELECT * FROM auto_ads WHERE id NOT IN ('3','4','5','6','7','8','9','11','12','15','16','221','235','245','246','250','251','252','253','254','255','256','260','261','262','263','264','265','266','321','391','392','396','397','398','399','407','530','544','545','546','547','548','630','689','1010','708','927','944','961','989','1057','1120','1121','1265','1495','1560','1640','1673','1798') AND aut_tp='1' AND hd!='1' ORDER BY vip DESC, SUBSTRING(rd,1,4) DESC, SUBSTRING(rd,6,2) DESC, SUBSTRING(rd,9,2) DESC, id DESC LIMIT -10,10