Welcome Guest, Not a member yet? Register   Sign In
$query->num_rows() - Fatal error: Call to a member function on a non-object
#6

[eluser]m4rw3r[/eluser]
why not add the db result directly to record? The result is the same (the foreach is a waste of cpu and memory, if you don't need to make any changes to the data).
Code:
$query = $this->db->query($sql);

$data['record'] = $query->result_array();

$this->load->view('your_view', $data);

BTW. It is the controller that calls the view, the model only fetches the data.


Messages In This Thread
$query->num_rows() - Fatal error: Call to a member function on a non-object - by El Forum - 04-20-2008, 10:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB