You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'order by ngaytao desc, stt asc' at line 1syntax error: select ten_vi,tenkhongdau,mota_vi,thumb,id,ngaytao,luotxem from table_news where hienthi=1 and id_cat= order by ngaytao desc, stt asc