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 '= dom_id WHERE app_delete IS NULL AND app_id=13' at line 3