for($i=0;$i<$_POST['hdnSumi'];$i++)
{
$strUpd = "UPDATE tbPO SET ";
$strUpd .="Qty_Order = ('".$_POST["hdnQty".$i]."'+(SELECT * FROM tbPO WHERE Vendor = '".$_POST["hdnVendor".$i]."' AND PO = '".$_POST["hdnPO".$I]."' AND Line = '".$_POST["hdnLine".$i]."'))";
$strUpd .=",Firm = '".$_POST["hdnFirm".$i]."' ";
$strUpd .="WHERE Vendor = '".$_POST["hdnVendor".$i]."' AND PO = '".$_POST["hdnPO".$I]."' AND Line = '".$_POST["hdnLine".$i]."' ";
$objQuery = mssql_query($strUpd);
if($objQuery){
echo "<script>alert('Update PO data Complete.')</script>";
echo "<meta http-equiv='refresh' content='0;url=Index_Center.php?id=frmIssueInvoice'>";
}else{
echo "Error Save [".$strSQL."]";
}
};
ส่วนด้านบนเป็น Code ครับช่วยตรวจสอบให้ทีครับ
Tag : PHP, MySQL, JavaScript, Ajax, Linux
Date :
2013-09-30 15:01:44
By :
TotEcom
View :
757
Reply :
3
No. 1
Guest
บรรทัดนี้ คุณ select ค่าอะไรมาใช้
Code (PHP)
$strUpd .="Qty_Order = ('".$_POST["hdnQty".$i]."'+(SELECT * FROM tbPO WHERE Vendor = '".$_POST["hdnVendor".$i]."' AND PO = '".$_POST["hdnPO".$I]."' AND Line = '".$_POST["hdnLine".$i]."'))";
$strUpd .="Qty_Order = ('".$_POST["hdnQty".$i]."'+(SELECT Qty_Order FROM tbPO WHERE Vendor = '".$_POST["hdnVendor".$i]."' AND PO = '".$_POST["hdnPO".$I]."' AND Line = '".$_POST["hdnLine".$i]."'))";