|
|
|
ดูโค้ด php ตัวนี้ให้หน่อยครับว่า ผิดตรงไหน คำสั่ง update ครับผม |
|
|
|
|
|
|
|
ผมเขียนแล้วมันก็ไม่อัพเดท ให้อะครับพี่ๆ ช่วยดูหน่อยครับ
Code (PHP)
<?
require_once('include/config.php');
require_once('include/mysql.php');
require_once('include/const.php');
$customer_code = $_REQUEST["customer_code"];
$customer_name = $_REQUEST["customer_name"];
$customer_address = $_REQUEST["customer_address"];
$customer_telephone = $_REQUEST["customer_telephone"];
$customer_email = $_REQUEST["customer_email"];
$customer_fiag = $_REQUEST["customer_fiag"];
if($customer_fiag == "on"){
$customer_fiag ="Y";
}else{
$customer_fiag."N";
}
$customer_remark = $_REQUEST["customer_remark"];
function show_customer()
{
global $customer_code,$customer_name,$customer_address,$customer_telephone,$customer_email,$customer_fiag,$customer_remark;
$connect = new Mysql();
$connect->begin();
$sql = "UPDATE customer SET customer_code='$customer_code'
WHERE customer_name='$customer_name'
or customer_address='$customer_address'
or customer_telephone='$customer_telephone'
or customer_eamil='$customer_email'
or customer_fiag='$customer_fiag'
or customer_remark'";
$sql = $sql."value (
'$customer_code','$customer_name','$customer_address','$customer_telephone','$customer_email','$customer_fiag','$customer_remark')";
$res = $connect->query($sql);
$eff = $connect->affected_rows($res);
if ($eff != 0 && $eff != 1)
{
$connect->rollback();
$connect->close();
return;
}
$connect->commit();
$connect->close();
}
?>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2011-07-28 17:05:40 |
By :
dekcomwat |
View :
766 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
$res = $connect->query($sql);
echo $sql;
เอาค่าออกมาดูหน่อยครับ
|
|
|
|
|
Date :
2011-07-28 17:30:45 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$sql = $sql."value (
'$customer_code','$customer_name','$customer_address','$customer_telephone','$customer_email','$customer_fiag','$customer_remark')";
|
|
|
|
|
Date :
2011-07-28 17:30:48 |
By :
PlaKriM |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|