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 'and type='product' order by stt,id desc' at line 1syntax error: select tenkhongdau_vi as tenkhongdau,ten_vi as ten,mota_vi as mota, link, thumb,photo,gia from table_product where hienthi =1 and id<>128 and id_doituong1= and type='product' order by stt,id desc