Welcome Guest, Not a member yet? Register   Sign In
problems with my models since the update
#1

[eluser]Piatra[/eluser]
I updated CI to 2.0 but now my models stopped working . Even a basic example such as this
Code:
class CrudModel extends CI_Model {
  
    function __construct()
    {
        parent::__construct();
    }
    
    function getAll()
    {
      $query = $this->db->get('links');
      ... // i left the rest of the code out becase the line above is the one with the error
    }
Keeps saying Call to a member function get() on a non-object in models\crudModel.php on line 13 . I'm sure its just something that changed in the update. can someone point it out for me ? thanks
#2

[eluser]InsiteFX[/eluser]
Make sure that you are loading the database library.

If it is loaded then try loading the database in your model and see if it works.

InsiteFX
#3

[eluser]Piatra[/eluser]
You were right i completely forgot to set that up after i updated.Thanks




Theme © iAndrew 2016 - Forum software by © MyBB