I m 建造一个简单的仪器,并试图测试非银的成果产出。 但不幸的是,所有天花都是一阵亡。 The controller Code excerpt:
$data[ query ] = $this->db->query( SELECT role_id, role_privilege FROM role );
$this->load->view( welcome_message , $data);
观点守则摘录:
<?php
echo count($query->result_array())."<br/>";
foreach ($query->result() as $row){
echo $row->role_id . <br/> ;
echo $row->role_privilege . <br/> ;
}
echo Total result .$query->num_rows();
?>
我的下一步是:
0
Total result
一条指挥线的争.有2个连续产出。 谁能指出什么是失踪?
EDITED:
This issue is also discussed here .
EDITED:
Maybe some platform specific stuff (I really doubt that)? I m running LAMP (php 5.3.2, mysql 5.1.37, apache 2.2.15).
EDITED:
This prints out a "Array ( )" string. My DB is 100% filled. I can say that for sure, because I did
INSERT INTO role(role_privilege) VALUES ( ROLE_MODERATOR );
INSERT INTO role(role_privilege) VALUES ( ROLE_USER );
然后通过指挥线检查。
EDITED:
After I put this into my controller:
echo $this->db->last_query(); exit;
我获得下一个产出:
SELECT role_id, role_privilege FROM role
而这正是我所需要的。 不幸的是,成果是 array块。