ทั้งหมดตามนี้เลยครับ

Code
<!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=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
#form1 table tr td p {
text-align: left;
}
#form1 table tr td {
text-align: left;
}
-->
</style>
</head>
<body>
<?php
include "function.php";
$sql = "SELECT * FROM comment where num='$num'";
$result = mysql_query( $sql, $conn );
$rs = mysql_fetch_array($result);
?>
<form id="form1" name="form1" method="post" action="upcomment.php?num=<?=$rs[num];?>">
<table width="408" height="365" border="1">
<tr>
<td width="84" height="75">ใส่ชื่อ :</td>
<td width="287"><label>
<input name="textfield" type="text" id="textfield" value="<?=$rs[name];?>" />
</label></td>
<td width="15"> </td>
</tr>
<tr>
<td height="194"><p>ข้อความ :</p></td>
<td><label>
<textarea name="textarea" id="textarea" cols="45" rows="15"><?=$rs[ms];?>
</textarea>
</label></td>
<td> </td>
</tr>
<tr>
<td height="33"><label>
<input type="submit" name="ตกลง" id="ตกลง" value="ตกลง" />
</label></td>
<td><label>
<input type="reset" name="ล้างข้อมูล" id="ล้างข้อมูล" value="ล้างข้อมูล" />
</label></td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
Code
<?
$dbhost="localhost"; //ระบุชื่อเครื่องเซฺฟเวอร์ที่ตั้ง MySql ถ้าใช้ localhost คือเครื่องเราเอง
$dbuser="root";
$dbpass="root";
$dbname="test";
$conn=mysql_connect($dbhost,$dbuser,$dbpass) or die ("Unable connect to MySQL Sever!!"); //สร้าง connection เก็บไว้ในตัวแปร $conn
mysql_select_db($dbname,$conn) or die ("Unable connect Database!!");
mysql_query("SET NAMES 'UTF8' ");
//echo "การเลือกใช้งานฐานข้อมูล $dbname สมบูรณ์";
?>
Code
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
include"function.php";
$sql="UPDATE comment set
name='$name',ms='$ms'where num='$num'";
$sqlquery=mysql_db_query($dbname,$sql);
print"<br>ได้รับข้อความของท่านเรียบร้อยแล้ว";
mysql_close($conn);
?>
</body>
</html>
โปรแกรมไม่มีคำสั่งฟ้องว่าผิดพลาดอะไรเลยครับ แต่ไม่ใส่ข้อมูลลงไปในหน้า php แล้ว แต่ข้อมูลไม่ไปที่ sql ซักตัวเลยครับ T_T
Tag : - - - -