Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my site have one error

Unable to locate the model you have specified: my_model

model :
PHP
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
  class My_Model extends CI_Model{
  		
  	public function __construct(){
  		parent::__construct();
		$this->load->database();
  	}
	/*
	 * insert in DATABASE*
	 */
	public function insert_entry($query){
		$this->db->insert('info',$query);
	}


controller:
PHP
$dt=array('upload_data' => $this->upload->data());
			$data=$this->upload->data();
			$inf =array(
			'file_name' =>$data['file_name'],
			);
			$this->load->model('my_model');
			$this->my_model->insert_entry($inf);
			$this->load->view('upload_success', $dt);


db :

PHP
$db['default']['hostname'] = '*********';
$db['default']['username'] = '*********';
$db['default']['password'] = '********';
$db['default']['database'] = '**************';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
Posted

1 solution

please help me
i don't know how fix it
 
Share this answer
 
Comments
Richard MacCutchan 29-Mar-14 10:00am    
Where is the model defined?
Mahshid Fallah 29-Mar-14 10:54am    
application/model/My_model
error :
Unable to locate the model you have specified: my_model
:(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900