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 id asc' at line 1syntax error: select id,ten_vi,tenkodau,photo,alt,title_vi,description_vi,keywords_vi from table_product_item where id!=41 and shows=1 and id_cat= order by id asc