|
|
|
แปลงค่าก่อนใช้คำสั่ง update ทำยังไงเหรอคะ รบกวนดูโค้ดให้หน่อย นะ |
|
|
|
|
|
|
|
Code (PHP)
if($_GET["Action"] == "Save")
{
for($i=1;$i<=$_POST["hdnLine"];$i++)
{
$strSQL = "UPDATE customer SET ";
$strSQL .="CustomerID = '".$_POST["txtCustomerID$i"]."' ";
$strSQL .=",Name = '".$_POST["txtName$i"]."' ";
$strSQL .=",Email = '".$_POST["txtEmail$i"]."' ";
$strSQL .=",CountryCode = '".$_POST["txtCountryCode$i"]."' ";
$strSQL .=",Budget = '".$_POST["txtBudget$i"]."' ";
$strSQL .=",Used = '".$_POST["txtUsed$i"]."' ";
$strSQL .="WHERE CustomerID = '".$_POST["hdnCustomerID$i"]."' ";
$objQuery = mysql_query($strSQL);
}
//header("location:$_SERVER[PHP_SELF]");
//exit();
}
Go to : PHP MySQL Multiple Rows Edit/Update Record
|
|
|
|
|
Date :
2011-03-23 21:07:28 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|