|
$query = $this->db->query("select count(*) as count from topic_base");
$count = $query->row_array();
$count = $count["count"];
上面是我写的读取记录总数,但事实上我以前习惯写(PDO):
$query = $db->query("select count(*) from topic_base")->fetch();
$count = $query[0];
我发现dodeigniter不能用数字索引,这个是不是在什么地方有个开关,或参数啥的? |
|