我有两个数组插入数据到数据库。第一个阵列就像如何在CodeIgniter模型中传递多个数组?
$data= array(
'date'=>$date,
'amount'=>$amt,
);
接下来的数组就像是一样的。但我必须检查一些条件。我把阵列状
if($mode == 1)
{
$data= array(
'Percentage'=>$percent,
'deduction'=>$deduct,
);
}
else if($mode ==2)
{
$data= array(
'Percentage1'=>$percent,
'deduction1'=>$deduct,
);
}
然后我用
$this->amout_model->insert_amount($data,$app_id);
但插入一个阵列的数据。如何插入两组数据?
你可以放置一个循环吗? – jycr753
百分比,扣除,百分比1,扣除1是您表中的不同字段 –
yes.different字段 – robins