在Codeigniter下,是否可能看到mysql_error()?
16lz
2021-01-22
I have an Codeigniter app (using version 2.1.0) that is writing a transaction to a mysql database. I'm fairly sure that I've got a foreign key constraint error occurring, but I can find no way to make CI tell me the specific error. mysql_error() comes back empty.
我有一个Codeigniter应用程序(使用2.1.0版本),它正在向mysql数据库编写事务。我很确定我有一个外键约束错误,但是我找不到办法让CI告诉我具体的错误。mysql_error()返回空。
Can anyone tell me how to get Codeigniter to tell me the mysql error message?
谁能告诉我怎么让Codeigniter告诉我mysql错误消息吗?
2 个解决方案
#1
36
Yes, this is the mysql_error() wrapper.
是的,这是mysql_error()包装器。
$this->db->_error_message();
And the mysql_errno wrapper is:
mysql_errno包装器为:
$this->db->_error_number();
更多相关文章
- 错误1452:无法添加或更新子行:外键约束失败
- Oracle相当于MySQL代码“插入虚拟”以返回错误消息
- MySQL添加外键错误1215
- 在SQL中声明@变量返回错误
- Linux第二篇----使用rpm方法安装MySQL(含各种出现的错误和排错)
- MySQL查询中的变量会导致错误
- mysql编译安装后各种常见错误集锦
- 保存在Java桌面应用程序应用程序和网站上使用的个人用户设置的最
- org.json Android系统错误。JSONException:在字符0处输入结束