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 a.cardkind_id = 0 and a.boc_no =(select boc_no from bankcards where billnum=' at line 1