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 'AND client_sow_packages.`publish_status` > 0 AND client_sow_packages.`fkdeals` >' at line 7