各位版大好
我在設定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
));
}
}