这是我插入记录的控制器代码。
function insert()
{
$first_name=$this->input->post('first_name');
$last_name=$this->input->post('last_name');
$father_name=$this->input->post('father_name');
$doj=$this->input->post('doj');
$course=$this->input->post('course_name');
$fee_pay=$this->input->post('fee_pay');
$photo=$this->input->post('photo');
$input=array(
'first_name'=>$first_name,
'last_name'=>$last_name,
'father_name'=>$father_name,
'date_of_join'=>$doj,
'course'=>$course
);
if($first_name!="" && $last_name!="" && $father_name!="" && $doj!="" && $course!="")
{
if(!$this->payment_model->insert($input))
{
//this is code to get data from fee database.
$fee['t']=$this->payment_model->select_fee($course);
//this code to get data from regestration database.
$id_data['data']=array($this->payment_model->select_id($first_name, $last_name, $father_name, $doj, $course));
echo "Student Detail Inserted";
$this->load->view('payment_step2');
}
else
{
echo "there is some problem in insertion";
}
}
else
{
echo "please enter all the option to insert detail of student";
}
}