<?
include("../lib/utility.php");
connect_db();
// Prepare Variables
$id = $_REQUEST["id"];
$status_order = $_REQUEST["status_order"];
// Check Input
$error = "";
// Action
if ($error == "") {
$sql = "UPDATE order SET ".
"status_order='$status_order' ".
"WHERE id = '$id'";
mysql_query($sql) or die(mysql_error());
}
// Show Result
if ($error == "") {
$result = "ทำรายการเรียบร้อยแล้ว<br />"
. "<a href='show_order.php'>แสดงหมวดสินค้า</a>";
}
else {
$result = $error
. "<a href='#' onclick='history.back(); return false;'>กลับไป</a>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ระบบตะกร้าสินค้า - เพิ่มหมวดสินค้า</title>
</head>
<body>
<?=$result?>
</body>
</html>
แล้วมัน eror น่ะครับ
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order SET status_order='' WHERE id = '12'' at line 1
Tag : - - - -
Date :
2010-02-05 00:03:32
By :
jiebspy
View :
937
Reply :
3
No. 1
Guest
$sql = "UPDATE `order` SET ".
"status_order='$status_order' ".
"WHERE id = '$id'";