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 ') order by id asc' at line 1 Select * From catalog Where id IN (187,106,188,189,190,191,192,193,194,195,196,197,198,199,200,201,91,0,0,0,64,65,66,67,69,70,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,) order by id asc