【发布时间】:2014-10-21 20:21:19
【问题描述】:
这是我的代码
$actor=$_SESSION['ID'];
$code= $_SESSION['order_code'];
$quantity_invoiced= $_POST['invoice'];
$price= $_POST['price'];
$charge= $_POST['tax'];
$total_items= $_POST['count'];
$account= $_POST['account'];
//first step update order table
for($y=0;$y<$total_items;$y++){
echo $price1 = round($price[$y]);
echo $quantity_invoiced1 = $quantity_invoiced[$y];
echo $charge1 = round($charge[$y]);
print_r( $insert_query="update tbl_order SET GENERAL_LEDGER='{$account}',RECEIVED='1',INVOICED_PRICE='{$price1}',QUANTITY_INVOICED='{$quantity_invoiced1}',CHARGES='{$charge1}',TOTAL_COST='{$price1}*{$quantity_invoiced1}' WHERE ORDER_CODE='{$code}' AND ACTOR='{$actor}'");
$stmt = $con->prepare( $insert_query );
$stmt->execute() ;
}
【问题讨论】:
-
“不运行”是什么意思?
-
请查询不更新表
-
您是否遇到任何错误?我没有看到任何错误检查。
-
没有。我注意到不是数组的字段已更新,但数组的字段未能更新
-
您要在列中插入一个数组?