我将两个表单数据作为数组。我想在表格中插入这些数据。
> var_dump($name);
array(3) { [0]=> string(5) "allen" [1]=> string(4) "dave" [2]=> string(3) "len" }
> var_dump($designation) ;
array(3) { [0]=> string(7) "analyst" [1]=> string(8) "designer" [2]=> string(2) "pm" }
下面是我的表插入查询
foreach ($name as $list) {
$sig = new Names;
$sig->name =$list;
$sig->designation =?;
$sig->festival = $id;
$sig->save();
}
如何插入desgination数组?请咨询