|
PHP复制代码
$this->load->database();
$query = $this->db->get('book_group');
var_dump($query);
复制代码
结果
| object(CI_DB_pdo_result)#16 (8) { | | ["num_rows"]=> | | int(0) | | ["conn_id"]=> | | object(PDO)#15 (0) { | | } | | ["result_id"]=> | | object(PDOStatement)#17 (1) { | | ["queryString"]=> | | string(24) "SELECT * | | FROM book_group" | | } | | ["result_array"]=> | | array(0) { | | } | | ["result_object"]=> | | array(0) { | | } | | ["custom_result_object"]=> | | array(0) { | | } | | ["current_row"]=> | | int(0) | | ["row_data"]=> | | NULL | | } |
|
查询数据库
SELECT * FROM book_group
+---------+-----------+------------+
| groupId | groupName | compeLevel |
+---------+-----------+------------+
| 101 | first | 101 |
| 102 | down | 102 |
| 103 | keep | 101 |
| 104 | all | 103 |
+---------+-----------+------------+
有4条数据 但是查不到
$query->result(); 空数组
|
|