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 desc limit 10' at line 2 SQL=select name, description from b2b_products where (name not like '%میلیمتر%') and (name not like '%اینچ%') and (description not like '') and () order by desc limit 10