Welcome Guest, Not a member yet? Register   Sign In
[newbie]Cannot load model
#1

HI  , i try to load model in a controller function :

this is my function :

Code:
public function prova(){
     
       $this->load->model('user_model');
       $data['record']=$this
                       ->user_model
                       ->recupera();
                       
       $this->load->view('user/prova',$data);
     
     
   }


in models i have file called user_model.php :

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');


class User_model extends CI_Model {
 
 
     public $users_table;

     public function __construct(){
       
        parent::__construct();

           $this->load->database();
       
        $this->users_table = $this->config->item('users_table');
       
     }      
     
     
     

 
   function recupera(){
   
    $this->db->where('email', '[email protected]');
    $q = $this->db->get('user')->row();

     return $q;
   
 }
 
 
 
 
}
when i go to :

http://localhost/user_codeigniter/index.php/user/prova


this error appear :

An uncaught Exception was encountered
Type: RuntimeException
Message: Unable to locate the model you have specified: User_model


i do permission 755 to folder  . but the error is the same
Reply


Messages In This Thread
[newbie]Cannot load model - by pippuccio76 - 06-15-2017, 02:25 PM
RE: [newbie]Cannot load model - by donpwinston - 06-15-2017, 04:49 PM
RE: [newbie]Cannot load model - by Paradinight - 06-15-2017, 11:05 PM
RE: [newbie]Cannot load model - by InsiteFX - 06-16-2017, 03:34 AM
RE: [newbie]Cannot load model - by InsiteFX - 03-08-2018, 10:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB