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 ads WHERE id NOT IN ('51','37','38','39','58','56','57','55','54','52','53','49','50','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','1494','1495','1496','1497','1498','1499','1500','1503','1504','1516','1523','1524','1683','2747','2748','2788','3238','3239','3240','3241','3242','4749','6313','6444','6463','7029','8233','8234','8235','8236','8237','8898','8899','8900','8901','8902','10300','10301','10520','10521','10713','11083','11084','11085','11086','11087') AND hd!='1' AND dl='0' AND ad_city='1' AND ( emp_id='3292' OR emp_id='3292')ORDER BY vip DESC, SUBSTRING(rd,1,4) DESC, SUBSTRING(rd,6,2) DESC, SUBSTRING(rd,9,2) DESC, id DESC LIMIT -10,10