我非常需要此解决方案.
这是我要检查的图像:
这是一个订单ID.这将是所有问题标题所共有的.
将这样插入:
这是我使用的代码:
if(isset($_POST['Submit'])){
try{
$orderNo = $_SESSION['orderNo'];
$serviceTitle=$_POST['serviceTitle'];
$price= $_POST['price'];
$quantity= $_POST['quantity'];
$amount= $_POST['amount'];
for ($i=0; $i
$statement = $db->prepare("INSERT INTO invoice (orderNo,productName,price,quantity,amount) VALUES (?,?,?,?,?)");
$statement->execute(array($orderNo,$serviceTitle[$i],$price[$i],$quantity[$i],$amount[$i]));
}
header("location: order_confirm_tech_step1.php");
}
catch(Exception $e) {
$error_message = $e->getMessage();
}
}
和我使用的每个数组输入类似:name =“ serviceTitle []”.
提前致谢.