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 '1483,5430,2720,13924,4651) order by newstime desc limit 40' at line 1 SELECT DISTINCT id FROM ***_enewstagsdata WHERE tagid IN (13825,,1483,5430,2720,13924,4651) order by newstime desc limit 40