[eluser]InsiteFX[/eluser]
You should not have to use get_instance in the model, I just wrote a model last night and did not have to use get_instance. If your creating a library then some times you need get_instance.
Model:
Code:
<?php
class Site_model extends CI_Model
{
function getAll()
{
//$this->CI = get_instance();
// $this->CI->load->database(); you do not need this here your loading the database in your controller
$q = $this->db->get('test');
if($q->num_rows() > 0)
{
// should be $q->result_array()
foreach($q->result_array() as $row)
{
$data[] = $row;
}
return $data;
}
}
}
InsiteFX