各位版大好
我在设定db连接的时候遇到下列的错误讯息
Unable to locate the model you have specified: Customermodel
照着google找到的讯息,大概都是说我大小写设定好就可以解决了
可是照着做还是喷错,想请益一下可能还有哪边没有设定好?
以下是程式码:
controller/Login.php
<?PHP
if ( !defined('BASEPATH')) OR exit('No direct script access allowed');
class Login extends CI_Controller{
puclic funtion save(){
$this->load->model('customermodel');
$this->customermodel->insert($firstName, $lastName);
}
}
models/customermodel.php
<?PHP
if( !defined('BASEPATH')) OR exit('No direct scirpt access allowed');
class Customermodel extends CI_Model{
public funtion __construct()
{
parent::__construct();
}
function insert($firstName, $lastName){
$this->db->insert('customer_data',
Array("firstName" => $firstName,
"lastName" => $lastName
));
}
}