【问题标题】:Using $query->field_data() in codeIgniter 2 / MySQL在 codeIgniter 2 / MySQL 中使用 $query->field_data()
【发布时间】:2013-02-24 09:22:23
【问题描述】:

我正在尝试使用

$query = $this->db->query("YOUR QUERY");
$fields = $query->field_data();

记录在本手册页的底部 http://ellislab.com/codeigniter/user-guide/database/fields.html

但我得到一个错误列表(超过 100 个),任何查询,甚至是简单的select * from tablename

我正在使用 CodeIgniter 2,PHP 版本 5.4.10,MySQL 版本 5.5.29

有人知道为什么会这样吗?

$sql = "SELECT * FROM `article`";
$query = $this->db->query($sql);
$fields = $query->field_data();

错误列表(前几个):

遇到 PHP 错误 严重性:通知消息:未定义 属性:stdClass::$Type 文件名:mysqli/mysqli_result.php 行 数量:89

遇到 PHP 错误 严重性:通知消息:未定义 属性:stdClass::$Field 文件名:mysqli/mysqli_result.php 行 数量:95

遇到 PHP 错误 严重性:通知消息:未定义 属性:stdClass::$Default 文件名:mysqli/mysqli_result.php 行 数量:97

遇到 PHP 错误 严重性:通知消息:未定义 属性:stdClass::$Key 文件名:mysqli/mysqli_result.php 行 数量:99

【问题讨论】:

  • 框架试图从字段元数据生成对象的行中出现错误。尝试执行 select * from performance_schema.rwlock_instances where write_locked_by_thread_id 不为空或 read_locked_by_count 不为空; select * from performance_schema.mutex_instances where locked_by_thread_id 不为空;我猜也许 mysql 会锁定元数据

标签: codeigniter codeigniter-2


【解决方案1】:

似乎是codeIgniter中的错误,他们在开发者分支中修复了它 https://github.com/EllisLab/CodeIgniter/commit/effd0133b3fa805e21ec934196e8e7d75608ba00

【讨论】:

    猜你喜欢
    • 2018-02-02
    • 1970-01-01
    • 2018-12-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-10
    • 2014-05-28
    • 1970-01-01
    相关资源
    最近更新 更多