[eluser]Coder Death[/eluser]
Hello to all,
I have my model with this function :
Code:
function getReportByDate(){
$result = Array();
$i = 0;
$q = "SELECT * FROM _my_report";
$q = $this->db->query($q);
if($q->num_rows() > 0)
{
foreach($q->result() as $q2){
$result[$i] = $q2;
$i++;
}
}
return $result;
}
in my controller I do this :
Code:
$this->load->model('getreport');
$totalreport = $this->getreport->getReportByDate();
if(count($totalreport) != 0 ){
$final = Array();
$final['a'] = $totalreport;
}
And in the view I get the data like this :
Code:
<?php
foreach($a as $list){
echo $list[$i];
$i++
}
But I have this error :
Code:
Object of class stdClass could not be converted to string
Please how can I solve this problem ?
Thanks