我在网上搜索但没有找到解决问题的方法。 我有一个动态生成的表单,我得到数组中的每个字段并插入它 到数据库,也像我update_batch它一样,
现在我想在update_batch期间记录我的数据库, 我的数据是否在数组中有没有办法只记录受影响的行?
这是我发送给update_batch模型的简单代码
$name = $this->input->post('name');
$type = $this->input->post('type');
$model = $this->input->post('model');
$license = $this->input->post('license');
$machine_no = $this->input->post('machine_no');
$value = $this->input->post('value');
$bought_date = $this->input->post('bought_date');
$bought_place = $this->input->post('bought_place');
$cur_price = $this->input->post('cur_price');
$bought_seller = $this->input->post('bought_seller');
$sfunds = $this->input->post('sfunds');
$u_rec_id = $this->session->userdata('rec_id');
$serial = $this->session->userdata('serial');
$all_array = array();
$form_data = array();
if($name)
{
if(is_array($name))
{
for($j=0; $j<count($name); $j++)
{
$this->ci_form = array(
'name' => $name[$j],
'vehicle_type' => $type[$j],
'made_model' => $model[$j],
'license' => $license[$j],
'machine_no' => $machine_no[$j],
'value' => $value[$j],
'date_acquired' => change_datei($bought_date[$j]),
'place_acquired' => $bought_place[$j],
'current_value' => $cur_price[$j],
'seller' => $bought_seller[$j],
'fund_source' => $sfunds[$j],
'userid' => $id,
'u_rec_id' => $u_rec_id,
'serial' => $serial,
'regdate' => date('Y-m-d H:m:s')
);
array_push($all_array, $this->ci_form);
}
}
}