<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Employee extends CI_Controller {
public function _construct()
{
parent::_construct();
$this->load->model('employee_model');
$this->load->helper(array('form','url'));
}
public function index()
{
$this->load->view('employee_form');
}
public function employee_form()
{
$save=array(
'emp_name' => $this->input->post('emp_name'),
'emp_gender' => $this->input->post('emp_gender'),
'emp_email' => $this->input->post('emp_email'),
'emp_phone' => $this->input->post('emp_phone'),
'emp_address' => $this->input->post('emp_address')
);
$this->employee_model->saveemployee($save);
redirect('employee/index');
}
}
這是我上面的代碼和錯誤顯示的打擊我在笨新鮮的,我需要幫助錯誤笨(數據在MySQL數據庫中未插入)
這是一個錯誤
請發表你的模型代碼。 – kishor10d
在codeigniter中,你不需要關閉控制器/模型/庫的理由http://www.codeigniter.com/user_guide/general/styleguide.html#php-closing-tag – user4419336