I intend to use an array to insert into my database, but only the first data have been inserted into the database and did not insert the other value, below is my code.
$orderID=mysqli_insert_id($con);
$query2="INSERT INTO user_order(orderID, productName,productPrice, Quantity) VALUES (?,?,?,?)";
$stmt=mysqli_prepare($con,$query2);
mysqli_stmt_bind_param($stmt,"isii", $orderID, $productName, $productPrice, $Quantity);
foreach($_SESSION['cart'] as $key => $values)
{
$productName = $values['Item_Name'];
$productPrice = $values['Price'];
$Quantity = $values['Quantity'];
mysqli_stmt_execute($stmt);
}