|
 |
|
ข้อมูลไม่อัพเดต รบกวนดูให้หน่อยครับ ผมลองเขียนแล้ว ไม่สามารถลงบทความในฐานข้อมูลได้ กรุณาตรวจสอบฐานข้อมูล กลับไปแก้ไข |
|
 |
|
|
 |
 |
|
ผมลองเขียนแล้ว
Code (PHP)
<?php
$uid = $_POST['uid'];
$name = $_POST['name'];
$email = $_POST['email'];
$username = $_POST['username'];
$password = $_POST['password'];
$date = $_POST['date'];
$status = $_POST['status'];
if($name=="" || $email=="" || $username=="" || $password=="" ){
echo"<center><font color=red>อัพเดทข้อมูลไม่สำเร็จ เนื่องจากกรอกข้อมูลไม่ครบ</font><br>";
echo"<a href=javascript:history.back();>กลับไปแก้ไข</a></center>";
}
$update_member="update $tbluser set name='$name', email='$email', username='$username', password='$password', date='$date', status='$status' where uid = '$uid'";
$result = mysql_db_query($db,$update_member);
echo $update_member;
if($result){
echo"<center>";
echo "<br>";
echo"<center><br><font color=red>อัพเดทข้อมูลเรียบร้อยแล้วครับ</font><br><br>";
echo"<a href=topic_details.php?qid=$qid>กลับไปดูรายละเอียด</a></center>";
echo"</center>";
}else {
echo"<center>";
echo"<br>";
echo "ไม่สามารถแก้ไขลงในฐานข้อมูลได้<br>";
echo"กรุณาตรวจสอบฐานข้อมูล<br>";
echo "<a href=javascript:history.back();>กลับไปแก้ไข</a>";
echo"</center>";
}
// ปิดการติดต่อฐานข้อมูล
mysql_close();
?>
ลองเทสผลลัพธ์ดูออกมา
update set name='aaaa', email='[email protected]', username='aaaa', password='123456', date='18 พ.ย. 51', status='Inactive' where uid = '1'
ไม่สามารถลงบทความในฐานข้อมูลได้
กรุณาตรวจสอบฐานข้อมูล
กลับไปแก้ไข
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-06-10 08:42:44 |
By :
ช่วยด้วยครับ |
View :
1007 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เพิ่มเติม
ตรง $db ผมใช้ include ("../config.inc.php");//ดึงไฟล์ Config.inc.php มาทำงานร่วมในไฟล์แล้วครับ
|
 |
 |
 |
 |
Date :
2009-06-10 08:44:37 |
By :
ช่วยด้วยครับ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|