|
 |
|
อยากจะทราบว่าทำไม save แล้วไม่มีอะไรเกิดขึ้นเลยคะ พอดีทำเป็นเบอร์ดคะ |
|
 |
|
|
 |
 |
|
พอบันทึกแล้วไม่ขึ้นอะไรเลยคะ ไม่ขึ้นแม่แต่คำว่าบันทึกเรียยร้อยแล้ว ไม่มีปฎิกิริยาอะไรเลยคะ ๆม่รู้เป็นเพราะอะไร ช่วยหน่อยนะคะ
Code (PHP)
<?
ob_start();
//============ Start Session และทำการเรียก Function ติดต่อฐานข้อมูล
session_start();
require("connect/connect.php");
require("connect/function.php");
$QuestionID =$_GET[QuestionID];
//============ กรณีทำการแสดงความคิดเห็น
if($_POST["COMMAND"] == "INSERT")
//$QuestionID =$_GET[QuestionID];
{
echo insert("QUESTION_ID,DESCRIPTION,NAME,CREATEDATE,IP","'".($_GET["QuestionID"])."','".($_POST["txtDESC"])."','".($_POST["txtNAME"])."','".(date("Y-m-d H:i:s"))."','".($_SERVER['REMOTE_ADDR'])."'","reply");
header("location:viewdetail.php?QuestionID=$_GET[QuestionID]");
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<title></title>
<link href="css/styles.css" rel="stylesheet" type="text/css">
</head>
<body topmargin="0">
<table width="778" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<?php require_once('head.php'); ?>
</td>
</tr>
<tr>
<td><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#f2f2f6" bgcolor="#FFFFFF">
<tr>
<td width="23%" valign="top"> <?php require_once('menuleft.php'); ?> <br> </td>
<td valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="417" height="310" valign="top">
<table width="592" border="0">
<tr>
<td><table width="593" height="22" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
<tr>
<td width="8"> <img src="image/menu01.jpg" width="8" height="22" alt=""></td>
<td width="389" background="image/menu02.jpg"><div align="center"><strong>รายละเอียด</strong><strong></strong></div></td>
<td width="9"> <img src="image/menu03.jpg" width="9" height="22" alt=""></td>
</tr>
</table></td>
</tr>
<?
//============ แสดงรายละเอียดของกระทู้
$result=select("question","WHERE 1 aND QUESTION_ID='".($_GET["QuestionID"])."'");
if(!$result)
{
header("location:webboard.php");
exit();
}
?>
<tr>
<td width="378" valign="top"><table width="100%" height="504" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"> <table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="FontBigSub">
<?=$result["SUBJECT"];?> </td>
</tr>
<tr>
<td><table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="boxtext"> </td>
</tr>
<tr>
<td width="77%" class="boxtext"><strong>
<?=($result["NAME"]);?>
</strong>+
<?=($result["CREATEDATE"]);?>
<span class="boxtext"> </span></td>
</tr>
</table></td>
</tr>
<tr>
<td class="boxtext style22">
<?=(nl2br($result["DESCRIPTION"]));?> </td>
</tr>
<tr>
<td align="right"><strong></strong></td>
</tr>
</table>
<hr align="left" width="100%" color="#D7ECa7">
<?
$strSQLReply="SELECT * FROM reply WHERE 1 AND QUESTION_ID='".($_GET["QuestionID"])."' ";
$QUERY=mysql_query($strSQLReply);
while($resultReply=mysql_fetch_array($QUERY))
{
?>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
<tr>
<td><table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="77%" class="boxtext"><strong>
<?=($resultReply["NAME"]);?>
</strong>+
<?=($resultReply["CREATEDATE"]);?>
<span class="boxtext"> </span> </td>
</tr>
</table></td>
</tr>
<tr>
<td class="boxtext style22">
<?=(nl2br($resultReply["DESCRIPTION"]));?> </td>
</tr>
<tr>
<td class="font0" align="right"></td>
</tr>
<tr>
<td></td>
</tr>
</table>
<hr align="left" width="100%" color="#D7ECa7">
<?
}
?>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><p><span class="boxtext"><strong><a name="Your comment">คำเตือน</a></strong><br>
<span class="style22">1. ใช้ถ้อยคำที่สุภาพ
<br>
2. ไม่มีเนื้อหาในเชิงกล่าวหา ให้ร้าย
หรือ หมิ่นประมาทผู้อื่น <br>
3. ไม่มีเนื้อหาที่เจตนาก่อให้เกิดความเข้าใจผิด
หรือ เจตนาให้เกิดความขัดแย้ง <br>
4. ไม่มีเนื้อหาที่ไม่เหมาะสม และ ผิดกฎหมาย
<br>
5. ไม่มีเนื้อหาโฆษณาขายสินค้าหรือบริการ </span></span></p>
<p><br>
<br>
</p></td>
</tr>
</table>
<script language="VBScript">
Sub btnSubmit_Onclick()
if TRIM(frmReply.txtDESC.value) = "" Then
msgbox "กรุณากรอก ความคิดเห็น", vbOkOnly + vbExclamation
frmReply.txtDESC.focus
Exit Sub
End IF
if TRIM(frmReply.txtNAME.value) = "" Then
msgbox "กรุณากรอก ชื่อ/อีเมล์", vbOkOnly + vbExclamation
frmReply.txtNaME.focus
Exit Sub
End IF
frmReply.COMMAND.value="INSERT"
frmReply.SUBMIT
End Sub
Sub btnReset_onClick()
ConFReset = MsgBox ( "คุณแน่ใจว่าต้องการ Reset Form ?", vbInformation + vbYesNo,"กรุณายืนยัน")
if ConFReset = vbYes then
frmReply.Reset
end if
End Sub
</script> <form action="viewdetail.php?QuestionID=<?=$_GET["QuestionID"];?>" method="post" name="frmReply" id="frmReply">
<div align="center">
<textarea name="txtDESC" cols="50" rows="10" id="txtDESC" class="txtbox"></textarea>
<input name="COMMAND" type="hidden" id="COMMAND">
<br>
<span class="boxtext"><span class="style22">ชื่อ/อีเมล์</span></span><br>
<input name="txtNaME" type="text" id="txtNAME" maxlength="100" class="txtbox">
<br>
<br>
<label>
<input name="btnSubmit" type="submit" id="btnSubmit" value="ตกลง">
</label>
<label>
<input name="btnReset" type="reset" id="btnReset" value="ยกเลิก">
</label>
</div>
</form></td>
</tr>
</table>
<br> <br> </td>
</tr>
</table>
<p class="style59"> </p>
<p class="style59"> </p>
<p class="style59"> </p></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" valign="top">
<?php require_once('down.php'); ?> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
Tag : PHP, MySQL

|
|
 |
 |
 |
 |
Date :
2013-05-04 11:33:55 |
By :
NToo |
View :
676 |
Reply :
5 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ช่วยหน่อยคะ เท่าที่ได้ดูจากฐาน QUESTION_ID มันไม่ยอมลงฐานในฐานมันเป็นแต่เลข0 คะ ไม่ทราบว่าอะไรผิดไปคะ
|
 |
 |
 |
 |
Date :
2013-05-04 19:25:33 |
By :
NToo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
QUESTION_ID ได้ตั้งไว้เป็น Auto increment หรือเปล่าครับ
|
 |
 |
 |
 |
Date :
2013-05-04 19:29:04 |
By :
Manussawin |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ป่าวคะ REPLY_ID ตั้งเป็นAuto increment ไว้คะ
|
 |
 |
 |
 |
Date :
2013-05-04 19:31:03 |
By :
NToo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่ทราบว่าเขียนส่งค่อะไรผิดไปหรือป่าวคะ
|
 |
 |
 |
 |
Date :
2013-05-04 19:50:30 |
By :
NToo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$_GET[QuestionID]; มีค่ามาหรือเปล่าครับ
|
 |
 |
 |
 |
Date :
2013-05-04 21:01:38 |
By :
Manussawin |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|