|
 |
|
ถามเรื่อง edit ครับผม เกิดปัญหาขึ้นมา รบกวนผู้รู้ทีน่ะครับ |
|
 |
|
|
 |
 |
|
Code (PHP)
<?php require_once('include/connect.php'); ?>
<?php require_once('include/resize.php'); ?>
<!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=windows-874" />
<title>Untitled Document</title>
</head>
<body>
<?php
$prid =$_REQUEST[prid];
$prhead =$_REQUEST[prhead];
$prdetail = $_POST['prdetail'];
$web =$_REQUEST[web];
$prname =$_REQUEST[prname];
$praddress =$_REQUEST[praddress];
$prphone =$_REQUEST[prphone];
$premail =$_REQUEST[premail];
$userlogin =$_REQUEST[userlogin];
$prpassword =$_REQUEST[prpassword];
$updatea =$_REQUEST[updatea];
mysql_query('SET NAMES UTF8');
$sql ="update pr set
prhead ='$prhead',
prdetail ='$prdetail',
website ='$web',
prname ='$prname',
praddress ='$praddress',
prphone ='$prphone',
premail ='$premail',
login ='$userlogin',
prpassword ='$prpassword',
where prid ='$prid'";
$result = mysql_query($sql) or exit ($sql);
die("<script>alert('ลงประกาศเรียบร้อยแล้ว');window.location='index.php';</script>");
?>
</body>
</html>
นี่คือ code หน้าที่ บันทึกข้อมูล น่ะครับ พอรับค่ามาจากฟอร์มปั๊บ มันแสดงอย่างนี้
update pr set ... คือ แสดง ข้อมูลทุกอย่าง ที่ส่งมาจากฟอร์มอะครับ แก้ยังไงเหรอครับ
Tag : PHP, MySQL

|
|
 |
 |
 |
 |
Date :
2011-12-06 11:37:37 |
By :
Guest |
View :
805 |
Reply :
7 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถามเรื่อง edit ครับผม เกิดปัญหาขึ้นมา
ปัญหาคืออะไรครับ???
นี่คือ code หน้าที่ บันทึกข้อมูล น่ะครับ พอรับค่ามาจากฟอร์มปั๊บ มันแสดงอย่างนี้
update pr set ... คือ แสดง ข้อมูลทุกอย่าง ที่ส่งมาจากฟอร์มอะครับ แก้ยังไงเหรอครับ
update pr set ... ไม่ต่อให้หมดหล่ะครับ เอาหน้า error มาได้ยิ่งดีน่ะครับ
|
 |
 |
 |
 |
Date :
2011-12-06 11:44:15 |
By :
mangkunzo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
update pr set prhead ='ทดสอบหัวข้อ', prdetail ='ทดสอบรายละเอียด',website ='ทดสอบ url',prname ='ทดสอบชื่อผู้ประกาศ',praddress ='ทดสอบบ้านเลขที่',prphone ='0800000000',premail ='ทดสอบอีเมล์',login ='username',prpassword ='password',prid =10
นี่อะครับ
|
 |
 |
 |
 |
Date :
2011-12-06 11:49:39 |
By :
ฟฟ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เนี่ยแหละครับ หน้า error
|
 |
 |
 |
 |
Date :
2011-12-06 11:50:27 |
By :
เนี่ยอะจร่ะ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มีใครพอจะทราบไหมเอ่ย
|
 |
 |
 |
 |
Date :
2011-12-06 12:23:21 |
By :
ฟฟ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอบความคิดเห็นที่ : 3 เขียนโดย : เนี่ยอะจร่ะ เมื่อวันที่ 2011-12-06 11:50:27
รายละเอียดของการตอบ ::
Code (PHP)
update pr set prhead ='ทดสอบหัวข้อ', prdetail ='ทดสอบรายละเอียด',website ='ทดสอบ url',prname ='ทดสอบชื่อผู้ประกาศ',praddress ='ทดสอบบ้านเลขที่',prphone ='0800000000',premail ='ทดสอบอีเมล์',login ='username',prpassword ='password',prid =10
// นี่ไม่ใช่ error น่ะครับ สรุปแล้ว code ที่เอามาลงมันคือยังไง
-update ไม่ผ่าน
-update แล้วข้อมูลไม่ครับ
-หรือ connect db,connect host ไม่ได้ หรืออะไรยังไง
|
 |
 |
 |
 |
Date :
2011-12-06 12:45:38 |
By :
mangkunzo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

นี่ครับ นี่ถ่ายจากมา browser
พอ กรอกข้อมูลที่จะ update เสร็จ
มันก็โชว์แบบนี้เลย ไม่มี error อะไรออกมา ไม่โชว์ line อะไรเลยอะครับ
รบกวนพี่ ๆ ทีน่ะครับ
|
 |
 |
 |
 |
Date :
2011-12-06 17:42:00 |
By :
Guest |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทราบสาเหตุเบื้องต้นครับผม...
เวลาที่มี กระทู้เดียว สามารถแก้ไข ได้... ถ้ามี เกิน 1 กระทู้ แก้ไขไม่ได้
<?php require_once('include/connect.php'); ?>
<?php require_once('include/resize.php'); ?>
<!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=windows-874" />
<title>Untitled Document</title>
</head>
<body>
<?php
$prid =$_REQUEST[prid];
$prhead =$_REQUEST[prhead];
$prdetail =$_REQUEST[prdetail];
$prname =$_REQUEST[prname];
$dateupdate = date("Y-m-d H:i:s");
mysql_query('SET NAMES UTF8');
$sql ="update pr2 set
prhead='$prhead',
prdetail ='$prdetail',
prname ='$prname',
dateupdate ='$dateupdate',
prid=$prid";
$result = mysql_query($sql) or exit ($sql);
die("<script>alert('ลงประกาศเรียบร้อยแล้ว');window.location='main.php';</script>");
?>
</body>
</html>
นี่คือ code รับข้อมูล
รบกวนผู้รู้นิดนึงน่ะครับ
|
 |
 |
 |
 |
Date :
2011-12-06 18:02:20 |
By :
Guest |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|