两个错误
错误 1
A PHP Error was encountered
Severity: Notice
Message: Use of undefined constant model_users - assumed 'model_users'
Filename: controllers/main.php
Line Number: 110
错误 2
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Main::$add_database
Filename: core/Model.php
Line Number: 51
控制器
if ($this->form_validation->run() == TRUE)
{
$this->load->model(model_users); //Line 110
$this->model_users->add_database;
}else{
$this->load->view('signup');
}
模型
public function add_database() {
$usersdata = array (
'email' => $this->input->post('email'),
'password' => md5($this->input->post('password')),
);
$regdetails = array (
'full_name' => $this->input->post('full_name'),
'gender' => $this->input->post('gender'),
'dob' => $this->input->post('dob'),
'address' => $this->input->post('address'),
'city' => $this->input->post('city'),
'state' => $this->input->post('state'),
'country' => $this->input->post('country'),
'pin' => $this->input->post('zip'),
'alternative_email' => $this->input->post('alt_email'),
'phone' => $this->input->post('phone'),
'mobile' => $this->input->post('mobile'),
);
$query = $this->db->insert('users',$usersdata);
$this->db->insert('tbl_studentreg',$regdetails);
}
我可以知道如何解决吗?在上面提到的代码中没有未来的错误。提前致谢..