select count(*) as total from wabu_comment where objectId= and objectName='wabu_info' 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 objectName='wabu_info'' at line 1