|
|
|
ดูโค้ด php ตัวนี้ให้หน่อยครับว่า ผิดตรงไหน คำสั่ง update ครับผม ผิดบรรทัดที่ 13 ไม่รุ้ หาไม่เจอ ดูให้ทีครับ |
|
|
|
|
|
|
|
Code (PHP)
<?
require_once('include/config.php');
require_once('include/mysql.php');
require_once('include/const.php');
$customer_id = $_REQUEST["customer_id"];
$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"];
$customer_remark = $_REQUEST["customer_remark"];
function show_customer(){
global $customer_id,$customer_code,$customer_name,$customer_address,$customer_telephone,$customer_email,$customer_fiag ,$cusotmer_remark;
$connect = new Mysql();
$sql ="UPDATE customer SET customer_code='$customer_code', customer_name='$customer_name', customer_address='$customer_address', customer_telephone='$customer_telephone',
customer_email='$customer_email', customer_fiag='$customer_fiag', customer_remark='$customer_remark' ";
$sql = $sql."WHERE customer_id='$customer_id'";
echo $sql;
$res = $connect->query($sql);
$connect->close();
if($res==true)
{
echo "แก้ไขเรียบร้อยแล้ว";
}else{
echo "ไม่สามารถแก้ไขได้";
}
echo"</table>";
}
?>
<BODY>
<?
show_customer();
?>
</BODY>
Tag : PHP, Ms Access
|
|
|
|
|
|
Date :
2011-07-29 10:09:26 |
By :
dekcomwat |
View :
814 |
Reply :
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ผิดตรงนี้
Code (PHP)
$sql = $sql."WHERE customer_id='$customer_id'";
แก้เป็นแบบนี้
Code (PHP)
$sql .="WHERE customer_id='$customer_id'";
|
|
|
|
|
Date :
2011-07-29 10:19:33 |
By :
mangkunzo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
แก้แล้วไม่ได้ครับพี่
มันขึ้นแบบนี้ครับ
Parse error: syntax error, unexpected T_STRING, expecting '{' in C:\AppServ\www\stock\customerupdate.php on line 14
|
|
|
|
|
Date :
2011-07-29 10:22:10 |
By :
dekcomwat |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo $sql ;
แล้วครับพี่ แต่มัน ขึ้น error
Parse error: syntax error, unexpected T_STRING, expecting '{' in C:\AppServ\www\stock\customerupdate.php on line 14
ยัง echo ไม่ได้เลย ครับพี่
|
|
|
|
|
Date :
2011-07-29 10:34:07 |
By :
dekcomwat |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
อืม มันมี อักขระอะไรไม่รู้อยู่หลัง () นะ ลบทิ้งก็หายละ
|
|
|
|
|
Date :
2011-07-29 10:46:47 |
By :
PlaKriM |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<?php
require_once('include/config.php');
require_once('include/mysql.php');
require_once('include/const.php');
$customer_id = $_REQUEST["customer_id"];
$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"];
$customer_remark = $_REQUEST["customer_remark"];
function show_customer() {
global $customer_id , $customer_code , $customer_name , $customer_address , $customer_telephone ,$customer_email,$customer_fiag ,$cusotmer_remark;
$connect = new Mysql();
$sql ="UPDATE customer SET customer_code='$customer_code', customer_name='$customer_name', customer_address='$customer_address', customer_telephone='$customer_telephone', customer_email='$customer_email', customer_fiag='$customer_fiag', customer_remark='$customer_remark' ";
$sql .= "WHERE customer_id='$customer_id'";
echo $sql;
$res = $connect->query($sql);
$connect->close();
if($res==true) {
echo "แก้ไขเรียบร้อยแล้ว";
} else {
echo "ไม่สามารถแก้ไขได้";
}
echo"</table>";
}
?>
<BODY>
<? show_customer();?>
</BODY>
ลองก๊อปไปแปะดู
|
|
|
|
|
Date :
2011-07-29 10:52:47 |
By :
adaaugusta |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|