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 ') and type='san-pham' order by stt asc' at line 1syntax error: SELECT id,ten_vi as ten, tenkhongdau_vi as tenkhongdau from table_tags where hienthi=1 and id in () and type='san-pham' order by stt asc