select * from ShopProduct where ( like '%%' or ( like '%%') or (REPLACE(, ' ', '') LIKE '%%')) and display = '1' order by updatetime desc 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 'like '%%' or ( like '%%') or (REPLACE(, ' ', '') LIKE '%%')) and display = '1'' at line 1