add error handling on database driver mysql and mysqli