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

[eluser]John_Betong_002[/eluser]
Did you check your error log?

If there are no errors to be fixed in your error log then I would try copying the example from "Creating your own Models" and change the values where required.

http://ellislab.com/codeigniter/user-gui...odels.html
Code:
<?php

class Blogmodel extends CI_Model {

    var $title   = '';
    var $content = '';
    var $date    = '';

    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }
    
    function get_last_ten_entries()
    {
      error_reporting(-1);
      ini_set('display_errors', 1);

      $this->load->database();

      $query = $this->db->get(' users', 10);
      
      return $query->result();
    }//

}//
 
 


Messages In This Thread
Fatal error: Call to a member function query() on a non-object - by El Forum - 06-16-2011, 10:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB