本文介绍了Mysql错误处理/尝试抓取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果表列不存在mysql显示错误。如何使用try catch或错误处理方法修复它

If table column does not exist mysql shows error .How to fix it using try catch or error handling method

谢谢

推荐答案

您可以以这种方式处理 mysql 错误

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'
}

这篇关于Mysql错误处理/尝试抓取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 12:02
查看更多