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 '-30,30' at line 1 in SELECT * FROM ads WHERE id NOT IN ('6','10','575','1200','47','59','4873','4874','4859','71','7141','6632','93','95','117','130','131','134','148','152','154','204','216','1028','232','242','263','265','266','272','275','9784','9394','280','281','287','291','293','330','347','360','390','393','395','396','397','6688','409','416','451','458','466','2010','487','7381','492','493','494','499','510','514','7222','7225','526','528','530','544','557','577','587','6728','615','623','626','630','638','640','5188','660','675','689','731','747','758','764','789','790','794','795','796','798','812','832','840','843','858','2130','864','872','890','903','914','1279','943','944','961','963','964','969','989','994','5186','1037','1039','1041','1052','1056','1057','1059','1154','1082','1089','1117','1248','1151','1155','1159','1167','1168','1175','1177','1188','1190','1193','1206','1199','2100','1205','1208','1217','1221','1222','1224','1228','1259','1262','1267','1287','1290','4901','4908','4920','4822','1381','1306','1308','1317','1324','1325','1326','1327','1328','1535','1359','1346','1331','1352','1355','1361','1364','1365','1367','1373','1384','1389','1391','1394','1395','1399','1403','1420','1423','1424','1427','1431','1432','1433','1435','1448','1449','1450','1462','1469','1509','4563','1523','4568','1549','1562','1565','1570','1599','1600','1602','1629','1630','1634','1647','1657','1661','1664','1676','1685','1689','1702','1742','1750','1752','1759','1763','1764','2105','1771','1775','1779','1790','1792','1810','1811','1828','1851','1865','1867','1895','1897','1929','1931','1949','1954','1973','1981','1982','1985','1992','2002','2200','2084','2099','2101','2102','2106','2122','2126','2139','2142','2204','2205','2206','2207','2208','2209','2210','2229','2341','2345','2392','2393','2467','2483','2569','2589','2593','2595','2611','2633','2634','2656','2657','2663','2779','2788','2811','2831','2839','2867','2870','3036','3094','3107','3109','3111','3125','3126','3133','3135','3136','3150','3204','3209','3218','3234','3275','3279','3292','3309','3310','3311','3312','3313','3328','3329','3374','3403','3410','3415','3419','3420','3427','3435','3464','3465','3472','3474','3497','5032','5062','3524','3532','3541','3580','3587','3588','3650','3653','3665','3681','3684','3710','3722','3724','3735','3746','3758','3771','3779','3780','3781','3805','3818','3897','3898','3912','3922','3933','3936','3940','3952','3996','4017','4018','4062','4089','4163','4221','4309','4390','4415','4424','4462','4488','4510','4511','4514','4550','6229','4744','4858','4678','4951','4791','4753','4720','4722','5309','5397','5436','5466','5560','5610','5645','5657','5682','5740','5742','5881','5883','6179','5952','5953','6049','6073','6288','6373','6377','6384','6422','6513','6523','6567','6753','6770','6780','6794','6845','6871','6888','6915','6931','6953','6965','7254','7428','7453','7565','7745','7754','7887','7915','8139','8259','8277','8317','8329','8412','8415','8416','8494','8530','11385','8605','8667','8725','8857','8975','9114','9134','9207','9308','9312','9420','9507','9627','9733','9772','9776','10610','10763','11150','11273','11515','11911') AND tp='2' ORDER BY vip DESC, id DESC LIMIT -30,30