Codeigniter 不返回数据库中的所有行

Codeigniter not returning all the rows from the database

如果你们中有人觉得这个问题很愚蠢,我们深表歉意。

这是我的问题:

我正在尝试使用以下查询从我的数据库中检索所有数据:

$this->db->where('chart_module', 'leads');
$query = $this->db->get('vtiger_charts')->result_array();

但我没有运气。我尝试只选择一个字段并使用 result() 获取结果,但也没有用。唯一有效的是 row_array() 但我只能从中获得一条记录。

这是我的控制器代码:

    $charts= $this->charts->get_leads();
    $this->load->view('home',$charts);

这是我的观点:

<?php
    echo $chart_series; // to test if I'm only getting a string. 

    foreach ($chart_series as $series){ //to test if I can get an array
        echo $series;
    }
?>

提前致谢。

问题已解决。 $data['result'] = $this->charts->get_leads();在控制器中。