【发布时间】: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 会锁定元数据