05-17-2011, 08:41 AM
[eluser]Perkin5[/eluser]
I've started following Jeffrey Way's Nettuts CodeIgniter video tutorials but although my code follows his exactly, I get an error at the line where the model function tries to 'get' a database table using active_record syntax.
The code isThe error is Fatal error: Call to a member function get() on a non-object
I have the code on my website where you can see the problem:
www.mikeheath.co.uk
and I'm wondering if the codeigniter version I have (2.0.2) differs substantially from the one he was using (1.7.1). I've already noticed that the base classes are now called CI_model etc instead of just model and there may be other changes. Is the active_record syntax the same?
By the way, I have checked the database config settings using a non-codeigniter file. Check it yourself at www.mikeheath.co.uk/dbtest.php
Grateful for any suggestions as to what is wrong.
I've started following Jeffrey Way's Nettuts CodeIgniter video tutorials but although my code follows his exactly, I get an error at the line where the model function tries to 'get' a database table using active_record syntax.
The code is
Code:
$q = $this->db->get('test');
I have the code on my website where you can see the problem:
www.mikeheath.co.uk
and I'm wondering if the codeigniter version I have (2.0.2) differs substantially from the one he was using (1.7.1). I've already noticed that the base classes are now called CI_model etc instead of just model and there may be other changes. Is the active_record syntax the same?
By the way, I have checked the database config settings using a non-codeigniter file. Check it yourself at www.mikeheath.co.uk/dbtest.php
Grateful for any suggestions as to what is wrong.