私は買い物カゴの一部として以下のコードを持っている。 Insert Ordersクエリが機能していますが、データを挿入するInsert Order_Infoクエリを取得できません。誰か助けてくれたら助けてくれますか?PHP Mysqli挿入が機能しないが、1か所のみである
<?php
include("includes/db.php");
include("includes/functions.php");
if($_REQUEST['command']=='update'){
global $mysqli;
$accountnumber=$_REQUEST['accountnumber'];
$addressbook=$_REQUEST['addressid'];
$date=date('Y-m-d');
$result=$mysqli->query("insert into Orders values('','$date','$findID','$addressbook','Pending')");
$orderid=mysql_insert_id();
$max=count($_SESSION['cart']);
for($i=0;$i<$max;$i++){
$pid=$_SESSION['cart'][$i]['productid'];
$q=$_SESSION['cart'][$i]['qty'];
$price=get_price($pid);
$sql("insert into Order_Info values ($orderid,$pid,$q,$price)");
} header("refresh:0;url=my_orders.php");
unset($_SESSION['cart']);
die('');
}
?>
ありがとう、どのように挿入されますか? – Trotterwatch
$ sql文の下で – PersyJack