myorder (pid,amount,ordernumber,time,uid,status) VALUES ";foreach ($gouwuche as $k => $v) { sql .= "(".$v['pid'].",".$v['amount'].",'$ordernumber','$time',1,0),";} sql = substr($sql, 0,strlen($sql)-1);把$gouwuche换你购物车里的内容,应该就可以了 ...
PHP mysql INSERT一次插入多条表单数据的方法
$sql = "insert into myorder (pid,amount,ordernumber,time,uid,status) VALUES ";
foreach ($gouwuche as $k => $v) {
$sql .= "(".$v['pid'].",".$v['amount'].",'$ordernumber','$time',1,0),";
}
$sql = substr($sql, 0,strlen($sql)-1);
把$gouwuche换你购物车里的内容,应该就可以了2019-04-04