|
|
|
ขอ code php "เมื่อใช้คำสั่ง edit ข้อมูล ให้บันทึกเข้าฐานข้อมูลครับ ฐานข้อมูล Oracle" |
|
|
|
|
|
|
|
Code (PHP)
<?
$objConnect = oci_connect("myuser","mypassword","TCDB");
$strSQL = "UPDATE CUSTOMER SET ";
$strSQL .="CUSTOMERID = '".$_POST["txtCustomerID"]."' ";
$strSQL .=",NAME = '".$_POST["txtName"]."' ";
$strSQL .=",EMAIL = '".$_POST["txtEmail"]."' ";
$strSQL .=",COUNTRYCODE = '".$_POST["txtCountryCode"]."' ";
$strSQL .=",BUDGET = '".$_POST["txtBudget"]."' ";
$strSQL .=",USED = '".$_POST["txtUsed"]."' ";
$strSQL .="WHERE CUSTOMERID = '".$_GET["CusID"]."' ";
$objParse = oci_parse($objConnect, $strSQL);
$objExecute = oci_execute($objParse, OCI_DEFAULT);
if($objExecute)
{
oci_commit($objConnect); //*** Commit Transaction ***//
echo "Save Done.";
}
else
{
oci_rollback($objConnect); //*** RollBack Transaction ***//
echo "Error Save [".$strSQL."";
}
oci_close($objConnect);
?>
Go to : PHP Oracle Edit/Update Record
|
|
|
|
|
Date :
2012-01-23 05:37:05 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|