|
|
|
php+sql server 2008 ไม่สามารถแก้ไขข้อมูลได้ครับ ช่วยตอบทีครับ |
|
|
|
|
|
|
|
ว่าแต่หน้า save มันอยู่ตรงไหนครับ
Code (PHP)
<html>
<head>
<title>ThaiCreate.Com PHP & SQL Server Tutorial</title>
</head>
<body>
<?
$objConnect = mssql_connect("localhost","sa","") or die("Error Connect to Database");
$objDB = mssql_select_db("mydatabase");
$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"]."' ";
$objQuery = mssql_query($strSQL);
if($objQuery)
{
echo "Save Done.";
}
else
{
echo "Error Save [".$strSQL."]";
}
mssql_close($objConnect);
?>
</body>
</html>
Go to : PHP SQL Server Edit/Update Record (mssql)
|
|
|
|
|
Date :
2011-05-13 18:08:18 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอโทษทีครับ ลืมตรวจสอบให้ดี อยู่นี่ครับ
Code (PHP)
<?
$objConnect = mssql_connect("TOPVIEWPOINT-PC","sa","1234") or die("Error Connect to Database");
$objDB = mssql_select_db("callcenter");
$strSQL = "UPDATE member SET ";
$strSQL .="mem_thname = '".$_POST["text_thname"]."' ";
$strSQL .=",mem_thsurname = '".$_POST["text_thsurname"]."' ";
$strSQL .=",mem_enname = '".$_POST["text_enname"]."' ";
$strSQL .=",mem_ensurname = '".$_POST["text_ensurname"]."' ";
$strSQL .=",mem_username = '".$_POST["text_username"]."' ";
$strSQL .=",mem_password = '".$_POST["text_password"]."' ";
$strSQL .=",mem_tel = '".$_POST["text_tel"]."' ";
$strSQL .=",depart = '".$_POST["department"]."' ";
$strSQL .=",level_id = '".$_POST["level"]."' ";
$strSQL .=",emp_code = '".$_POST["emp"]."' ";
$strSQL .="WHERE id = '".$_GET["Mem_1"]."' ";
$objQuery = mssql_query($strSQL);
if($objQuery)
{
echo "<script>window.location.href='user.php'</script>";
}
else
{
echo "Error Save [".$strSQL."]";
}
mssql_close($objConnect);
?>
|
|
|
|
|
Date :
2011-05-13 18:13:53 |
By :
Zeus |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|