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 stt,ngaytao desc' at line 1syntax error: select id,thumb,photo,ten_vi,tenkhongdau from table_product where hienthi=1 and type='product' and id_item= order by stt,ngaytao desc