$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换你购物车里的内容,应该就可以了