[eluser]SamoualSys[/eluser]
the controler
Code:
function totaltrans()
{
$this->load->model('report_model');
$results = $this->report_model->total_trans_num();
$data['films'] = $results['rows'];
$data['num_results'] = "My Real Title";; // this for test the result in the view
$this->load->view('report',$data);
}
the model
Code:
function total_trans_num ()
{
// results query
$q = $this->db->select('recev_name,Send_amount,Cur_rate,Recev_amount,User_name,Recev_country,Sender_country,Sender_name,Cur_recev,Cur_send,Op_time,ID')
->from('trans')
->limit($limit, $offset)
->order_by($sort_by, $sort_order);
$ret['rows'] = $q->get()->result();
// count query
$q = $this->db->select('COUNT(*) as count', FALSE)
->from('trans');
$tmp = $q->get()->result();
$ret['num_rows'] = $tmp[0]->count;
return $ret;
in the view iam just showing the
Code:
<p><?echo $num_results;?></p>
it come with this error
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: num_results
Filename: views/report.php
Line Number: 34