You have an error in your Query:(SELECT * FROM `dwgreen_cms`.recipes WHERE recipe_id= OR recipe_root_id= ORDER BY FIELD(recipe_id, '')) 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 'OR recipe_root_id= ORDER BY FIELD(recipe_id, '')' at line 1