-1
使用codeigniter模型插入和检索包含数组的数据。在插入检索数据中插入检索数据codeigniter模型
型号:
function abc {
$tomorrow_date=$this->input->post('datee');
$id=$this->input->post('id');
$this -> db -> select('name,phone,address,age');
$this -> db -> from('user_reg');
$this -> db -> where('patient_id',$id);
$this -> db -> where('date',$tomorrow_date);
$query = $this -> db -> get();
if ($query->num_rows() > 0)
{
$row = $query->row();
}
我想插入如:
$data = array(
'date'=>$tomorrow_date,
'name'=>$name,
'phone'=>$phone,
'address'=>$address,
'age'=>$age,
'patient_id'=>id,
);
$this->db->insert('user_info',$data);
}
我怎样才能插入数据?