Author Topic: codeigniter help with retrieving info from db  (Read 1140 times)

0 Members and 1 Guest are viewing this topic.

Offline dadamssgTopic starter

  • Devotee
  • Posts: 713
    • View Profile
codeigniter help with retrieving info from db
« on: January 06, 2010, 08:23:50 PM »
so im going their there tutorial and this line of code is throwing an error. i have done everything else correctly.
Code: [Select]
$data['query'] = $this->db->get('test');
i get this

Fatal error: Call to a member function get() on a non-object in /controllers/blog.php on line 16

and yes 'test' is the name of my table in my database. And it does have several rows

anyone know what im doing wrong????

Offline thorpe

  • Administrator
  • 'Mind Boggling!'
  • *
  • Posts: 29,255
    • View Profile
Re: codeigniter help with retrieving info from db
« Reply #1 on: January 06, 2010, 08:55:32 PM »
It would appear $this->db is not an object. Where is it defined?

ps: I'm not a CI user.

Offline dominicd

  • Irregular
  • Posts: 19
    • View Profile
Re: codeigniter help with retrieving info from db
« Reply #2 on: January 15, 2010, 06:56:13 AM »
$this->db->get
is part of the CI libraries as long as he is loading the libraries via autoload.php or

class Blog extends Controller()