A,B,C,D,E表示城市被选中的结果
其余表单都是统一的
我希望当用户勾选C和D的时候
mysql数据库里面记录两条数据 一条是C一条是D,其他表单信息都统一
请问哪位大侠有好的方案分享么!
我就是不清楚是一条一条验证插入,还是一批验证插入
要是一条一条插入的话,添加成功是不是要弹出很多提示呢
我的代码如下
public function insert() {
$data = I('post.');
if (count($data['city_shi']) = 0) {
$this->error('请选择城市!');
} else {
foreach ($data['city_shi'] as $k => $v) {
}
}
if ($this->DB->create($data)) {
if (false !== $this->DB->add()) {
$this->success('提交成功!');
} else {
$this->error('提交失败!');
}
} else {
$this->error($this->DB->getError());
}
} 最佳答案