Invalid SQL: SELECT counter FROM attachment WHERE attachmentid = undefined mysql error: Unknown column 'undefined' in 'where clause' mysql error number: 1054