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 month='2009-07' AND lang='eng'' at line 1-Error SELECT prodcount from hitscb WHERE custid= AND month='2009-07' AND lang='eng'