|
|
|
สอบถามการ update ข้อมูลแบบ array ครับ พอกดอัปเดท กลับเป็นการเพิ่มข้อมูล แทน |
|
|
|
|
|
|
|
Code (PHP)
$stock_num_run=$_GET['stock_num_run'];
$stock_date=$_POST['stock_date'];
$stock_name=$_POST['stock_name'];
$sum_vat=$_POST['sum_vat'];
$sum_not_vat=$_POST['sum_not_vat'];
foreach($_POST['stock_order_ID'] as $key => $stock_order_ID){
$insert="UPDATE `stockorder` SET
stock_date='$stock_date' , stock_name='$stock_name' , sum_vat='$sum_vat', sum_not_vat='$sum_not_vat'
, stock_order_ID='{$_POST['stock_order_ID'][$key]}'
, stock_price='{$_POST['stock_price'][$key]}'
, stock_price_sum='{$_POST['stock_price_sum'][$key]}'
, stock_id='{$_POST['stock_id'][$key]}'
WHERE stock_id='{$_POST[stock_id]}' AND stock_num_run='{$_POST[stock_num_run]}'";
$result=mysql_query($insert);
if($result){
mysql_query("COMMIT");
al("success!!");
redi3("invoice_bin_out_search.php?stock_num_run=$stock_num_run");
}else{
echo mysql_error();
mysql_query("ROLLBACK");
al("not success!!");
redi3("javascript:history:back();");
}
}
Tag : PHP, HTML/CSS, JavaScript, Ajax, jQuery
|
|
|
|
|
|
Date :
2013-09-04 16:40:15 |
By :
rock_rock |
View :
824 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|