问题
If table column does not exist mysql shows error .How to fix it using try catch or error handling method
Thanks
回答1:
you can handle the mysql
error
in this way
if ( ! $this->db->query('SELECT `name`,`age` FROM `example`'))
{
$error = $this->db->error(); // Has keys 'code' and 'message'
}
来源:https://stackoverflow.com/questions/44732546/mysql-error-handling-try-catch