Welcome Guest, Not a member yet? Register   Sign In
load model from own class
#3

[eluser]wiZe[/eluser]
ok this is my loaded model:

Code:
<?php
    class Admin_sandwhich_model extends Model
    {
        function Admin_sandwhich_model()
        {
            parent::Model();
        }
        
        function get_data($id)
        {
            $this->db->select('*');
            $this->db->where('sandwhich_id', $id);
            $this->db->get();
            
            return $query->row_array();
        }
    }
?>

but i think its somethin wrong with the references between the classes. the error "...Call to a member function select() on a non-object..." says that my Sandwhich instance is not an object. or am i wrong?


Messages In This Thread
load model from own class - by El Forum - 11-17-2008, 06:42 AM
load model from own class - by El Forum - 11-17-2008, 06:45 AM
load model from own class - by El Forum - 11-17-2008, 06:50 AM
load model from own class - by El Forum - 11-17-2008, 06:56 AM
load model from own class - by El Forum - 11-17-2008, 07:00 AM
load model from own class - by El Forum - 11-17-2008, 07:51 AM
load model from own class - by El Forum - 11-17-2008, 07:52 AM
load model from own class - by El Forum - 11-17-2008, 07:54 AM
load model from own class - by El Forum - 11-17-2008, 09:05 AM
load model from own class - by El Forum - 11-17-2008, 09:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB