|
 |
|
update ไม่ผ่านคะ รบกวนด้วยนะคะ ว่าติดตรงไหน หรือ ข้ามตรงไหนไปหรือเปล่า |
|
 |
|
|
 |
 |
|
รบกวนด้วยนะคะ ว่าติดตรงไหน หรือ ข้ามตรงไหนไปหรือเปล่า พอดีเป็นฟอร์มแก้ไข สมาชิกนะคะ พอกด แกไข แล้วระบบบอกว่า "ไม่สามารถแก้ไขได้"
Code (PHP)
<?
$photo=$_POST[photo];
$sex=$_POST[sex];
$name1=$_POST[name1];
$name2=$_POST[name2];
$name3=$_POST[name3];
$name4=$_POST[name4];
$idcard=$_POST[idcard];
$tel=$_POST[tel];
$tel2=$_POST[tel2];
$fax=$_POST[fax];
$no=$_POST[no];
$house=$_POST[house];
$road=$_POST[road];
$tumbol=$_POST[tumbol];
$amphur=$_POST[amphur];
$province=$_POST[province];
$postal_code=$_POST[postal_code];
$email=$_POST[email];
$fileupload=$_FILES['fileupload']['tmp_name'];
$fileupload_name=$_FILES['fileupload']['name'];
$fileupload_size=$_FILES['fileupload']['size'];
$fileupload_type=$_FILES['fileupload']['type'];
include "./include/config.php";
if ($chkdel=="1") {
$sql3="update member set photo='' where user ='$sess_user' ";
$result3=mysql_db_query($dbname,$sql3);
unlink("photo/$photo_del");
}
if ($fileupload) {
$array_last=explode(".",$fileupload_name);
$c=count($array_last)-1;
$lastname=strtolower($array_last[$c]) ;
if ($lastname=="gif" or $lastname=="jpg" or $lastname=="jpeg" or $lastname=="png") {
$photoname=$sess_user.".".$lastname;
copy($fileupload,"photo/".$photoname);
$sql3="update member set photo='$photoname' where user='$sess_user' ";
$result3=mysql_db_query($dbname,$sql3);
}
unlink($fileupload);
}
$sql="update member SET idcard='$idcard',
sex='$sex',
name1='$name1',
name2='$name2',
name3='$name3',
name4='$name4',
tel='$tel',
tel2='$tel2',
fax='$fax',
no='$no',
house='$house',
road='$road',
tumbal='$tumbal',
amphur='$amphur',
province='$province',
postal_code='$postal_code',
email='$email' where user='$sess_user'";
$result=mysql_db_query($dbname,$sql);
if ($result) {
echo"<META HTTP-EQUIV='REFRESH' CONTENT='0; URL=c.php'>";
echo "<script>alert('แก้ไขข้อมูลเรียบร้อยแล้วคะ')</script>";
} else {
echo"<META HTTP-EQUIV='REFRESH' CONTENT='0; URL=c_edit.php'>";
echo "<script>alert('ไม่สามารถแก้ไขข้อมูลได้')</script>";
}
mysql_close();
?>
ขอบคุณมากๆคะ
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-08-05 15:28:45 |
By :
แตง |
View :
887 |
Reply :
9 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลอง Echo $sql ออกมาดูครับ
|
 |
 |
 |
 |
Date :
2009-08-05 15:47:26 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<?php
$sql="update member SET idcard='$idcard',
sex='$sex',
name1='$name1',
name2='$name2',
name3='$name3',
name4='$name4',
tel='$tel',
tel2='$tel2',
fax='$fax',
no='$no',
house='$house',
road='$road',
tumbal='$tumbal',
amphur='$amphur',
province='$province',
postal_code='$postal_code',
email='$email' where user='$sess_user'";
$result=mysql_db_query($dbname,$sql);
echo $sql;
exit();
?>
เอาค่าที่ได้ไปทดสอบใน phpMyAdmin น่ะครับ
|
 |
 |
 |
 |
Date :
2009-08-05 15:51:06 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่ทันน้องเป้
|
 |
 |
 |
 |
Date :
2009-08-05 15:52:03 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แป๊ะ ครับพี่ ไม่ใช่เป้ 
|
 |
 |
 |
 |
Date :
2009-08-05 16:19:02 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
555+ เป้ซ่ะแล้ว
|
 |
 |
 |
 |
Date :
2009-08-05 16:33:48 |
By :
danya |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
555 แล้วชอบเพรงร็อคป่าว
|
 |
 |
 |
 |
Date :
2009-08-05 17:03:25 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เป้สะเลอเปล่า
|
 |
 |
 |
 |
Date :
2009-08-05 17:21:17 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แง๊บ ๆ น้อง แปะ พี่ล้อเล่นเด่อ
|
 |
 |
 |
 |
Date :
2009-08-05 17:26:40 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
สรุปว่า จขกท ทำได้รึยังครับ 
|
 |
 |
 |
 |
Date :
2009-08-05 17:42:51 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|