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();

更多相关文章

  1. 错误1452:无法添加或更新子行:外键约束失败
  2. Oracle相当于MySQL代码“插入虚拟”以返回错误消息
  3. MySQL添加外键错误1215
  4. 在SQL中声明@变量返回错误
  5. Linux第二篇----使用rpm方法安装MySQL(含各种出现的错误和排错)
  6. MySQL查询中的变量会导致错误
  7. mysql编译安装后各种常见错误集锦
  8. 保存在Java桌面应用程序应用程序和网站上使用的个人用户设置的最
  9. org.json Android系统错误。JSONException:在字符0处输入结束

随机推荐

  1. Android sqlite
  2. EditText设置键盘操作
  3. ~/.dirlst 文件
  4. Android——蓝牙通信
  5. Android中使用ViewPage进行广告轮播测试
  6. Android Building System 分析
  7. android MotionEvent中getX()和getRawX()
  8. android设置不显示标题
  9. 圆圈里面是个叉号
  10. mainfest文件中android属性