CodeIgniter Forums
Fatal error: Call to a member function load() on a non-object in system/database/DB_driver.php on line 1133 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Fatal error: Call to a member function load() on a non-object in system/database/DB_driver.php on line 1133 (/showthread.php?tid=17510)



Fatal error: Call to a member function load() on a non-object in system/database/DB_driver.php on line 1133 - El Forum - 04-07-2009

[eluser]otherjohn[/eluser]
Hi all.
I have the following code in a model.
Code:
$select='p.id, p.name_'. $this->_lang .', ap.price';
            
            $this->db->select($select);
            $this->db->from('Products p, Agents_Products ap');
            $this->db->where('ap.agent_id', $this->agent->id);
            $this->db->where('ap.state', $this->state);
            $this->db->where('ap.product_id = p.id');
            $this->db->where('p.product_type', $this->product_type);
            $this->db->where('p.customer_type',$this->customer_type);
             //This will execute the query and collect the results and other properties of the query into an object.
            $query = $this->db->get();
return $query->result_array();
I get the Fatal error: Call to a member function load() on a non-object in system/database/DB_driver.php on line 1133
error when this is run.
I am using language files, but I am not sure why this error is thrown. Can someone help?


Fatal error: Call to a member function load() on a non-object in system/database/DB_driver.php on line 1133 - El Forum - 04-07-2009

[eluser]pistolPete[/eluser]
Do you autoload the database?


Fatal error: Call to a member function load() on a non-object in system/database/DB_driver.php on line 1133 - El Forum - 04-07-2009

[eluser]otherjohn[/eluser]
I Didnt before this error, but then I did and it still produced the error.

This is just an overlaying error. I did find the true DB error underneath it. But still don't know why this was thrown.