Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > รบกวนอีกด้วยนะคะ คือว่าพอกดลบข้อมูลแล้วข้อมูลไม่แสดงค่ะ แต่ในฐานข้อมูลลบได้ตามข้อมูลที่เรากดลบ ไม่รู้เป็นเพราะอะไร แก้มาทั้งวันก็ยังไม่ได้ค่ะ



 

รบกวนอีกด้วยนะคะ คือว่าพอกดลบข้อมูลแล้วข้อมูลไม่แสดงค่ะ แต่ในฐานข้อมูลลบได้ตามข้อมูลที่เรากดลบ ไม่รู้เป็นเพราะอะไร แก้มาทั้งวันก็ยังไม่ได้ค่ะ

 



Topic : 099218



โพสกระทู้ ( 61 )
บทความ ( 0 )



สถานะออฟไลน์




ข้อมูลที่ว่าเป็นข้อมูลเว็บบอร์ดค่ะ พอดีว่าจะให้มีการลบคำตอบได้ค่ะ

webboard

ถ้ากดลบมันลบให้เราในฐานข้อมูลตามไอดีของคำตอบที่เราลบได้ค่ะ แต่ว่าพอกดปุ๊บมันก็มาหน้าเดิม แต่ไม่มีข้อมูลแสดงเลยค่ะ แบบนี้ค่ะ

ไม่ขึ้น

แต่ถ้ากดไปหน้าของคำถามใหม่มันก็แสดงนะคะ
ไม่รู้ว่าเป็นเพราะโค๊ดส่วนไหน รบกวนพี่ๆช่วยดูอีกทีนะคะ
นี่เป็นโค๊ดของหน้านี้ค่ะ

Code (PHP)
<? 
include( "../config.php");
if($_GET["Action"] == "Save")
{
	//*** Insert Reply ***//
	$strSQL = "INSERT INTO reply ";
	$strSQL .="(QuestionID,CreateDate,Details,Name) ";
	$strSQL .="VALUES ";
	$strSQL .="('".$_GET["QuestionID"]."','".date("Y-m-d H:i:s")."','".$_POST["txtDetails"]."','".$_POST["txtName"]."') ";
	$objQuery = mysql_query($strSQL);
	
	//*** Update Reply ***//
	$strSQL = "UPDATE webboard ";
	$strSQL .="SET Reply = Reply + 1 WHERE QuestionID = '".$_GET["QuestionID"]."' ";
	$objQuery = mysql_query($strSQL);	
}
//*** Delete Condition ***//
if($_GET["Action"] == "Del")
{
	$strSQL = "DELETE FROM reply ";
	$strSQL .="WHERE ReplyID = '".$_GET["ReplyID"]."' ";
	$objQuery = mysql_query($strSQL);
	if(!$objQuery)
	{
		echo "Error Delete [".mysql_error()."]";
	}
	//header("location:$_SERVER[PHP_SELF]");
	//exit();
}
//*** Select Question ***//
$strSQL = "SELECT * FROM webboard  WHERE QuestionID = '".$_GET["QuestionID"]."' ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$objResult = mysql_fetch_array($objQuery);

//*** Update View ***//
$strSQL = "UPDATE webboard ";
$strSQL .="SET View = View + 1 WHERE QuestionID = '".$_GET["QuestionID"]."' ";
$objQuery = mysql_query($strSQL);	
$strSQL2 = "SELECT * FROM reply  WHERE QuestionID = '".$_GET["QuestionID"]."' ORDER BY CreateDate ";
$objQuery2 = mysql_query($strSQL2) or die ("Error Query [".$strSQL."]");
?>
<!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>
<title>Admin</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body {
	background-color: #CCCCCC;
}
a:link {
	color: #FF9900;
	text-decoration: none;
}
a:visited {
	color: #FF6633;
	text-decoration: none;
}
a:hover {
	color: #FFCC66;
	text-decoration: none;
}
a:active {
	color: #FF9900;
	text-decoration: none;
}
.style1 {
	color: #660000;
	font-weight: bold;
}
.style4 {color: #660000}
.style5 {
	color: #FF6633;
	font-weight: bold;
}
-->
</style></head>
<body>	
<form action="Viewwebboard_Admin.php?QuestionID=<?=$_GET["QuestionID"];?>&Action=Save" method="post" name="frmMain" id="frmMain">
  <table width="1000" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#FFFFFF">
    <tr>
      <td colspan="4"><img src="../images/aaa.jpg" width="228" height="105" />       </td>
    </tr>
    <tr>
      <td width="236" bgcolor="#666666">&nbsp;</td>
      <td width="183" bgcolor="#666666">&nbsp;</td>
      <td width="376" bgcolor="#666666">&nbsp;</td>
      <td width="193" bgcolor="#666666">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="4" bgcolor="#FFFFFF"> <div align="center" class="style1">ตอบคำถามเว็บบอร์ด</div>
    <tr>
        <th scope="row">&nbsp;</th>
        <td colspan="4"><table width="560" border="0" cellpadding="0" cellspacing="0" bgcolor="#FF9966">
          <tr>
            <td colspan="4" bgcolor="#FF9966" align="center"><?=$objResult["Question"];?>            </td>
          </tr>
          <tr>
            <td height="53" colspan="4" bgcolor="#FFFFCC"><div align="left"><span class="style4">
                <?=$objResult["Details"];?>
            </span></div></td>
          </tr>
          <tr>
            <td width="142" bgcolor="#FDDFA5"><span class="style4">
              ชื่อ 
              :
              <?=$objResult["Name"];?>
            </span></td>
            <td width="261" bgcolor="#FDDFA5"><span class="style4">
              วันที่สร้าง
              :
              <?=$objResult["CreateDate"];?>
            </span></td>
            <td width="70" bgcolor="#FDDFA5">&nbsp;</td>
            <td width="87" bgcolor="#FDDFA5">&nbsp;</td>
          </tr>
        </table></td>
             </tr>
			  
              <tr>
                <th scope="row">&nbsp;</th>
                <td></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td width="2">&nbsp;</td>
              </tr>
			  <?
                            $intRows = 0;
                            while($objResult2 = mysql_fetch_array($objQuery2))
                             {
	                     $intRows++;

                             ?>
                  <tr>	  
                <th scope="row">&nbsp;</th>
                <td colspan="3" rowspan="3" bgcolor="#FFFFFF"><span class="style5">No :
                <?=$intRows;?>
                </span>
                  <table width="563" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFCCFF">
                  <tr>
                    <td height="53" colspan="3" bgcolor="#FCFCF2"><span class="style4">
                      <?=nl2br($objResult2["Details"]);?>
                    </span></td>
                  </tr>
                  <tr>
                    <td width="104" bgcolor="#FDDFA5"><span class="style4">ชื่อ 
                      :
                        <?=$objResult2["Name"];?>
                    </span></td>
                    <td width="196" bgcolor="#FDDFA5"><span class="style4">วันที่สร้าง 
                      :
                        <?=$objResult2["CreateDate"];?>
                    </span></td>
                    <td width="282" bgcolor="#FDDFA5"><a href="JavaScript:if(confirm('ยืนยันการลบข้อมูล?')==true){window.location='Viewwebboard_Admin.php?Action=Del&ReplyID=<?=$objResult2["ReplyID"];?>';}"><img src="../images/Delete.jpg" width="18" height="18" /></a></td>
                  </tr>
          </table>  </td>
                <td bgcolor="#FFFFFF">&nbsp;</td>
                  </tr>
              <tr>
                <th scope="row">&nbsp;</th>
                <td bgcolor="#FFFFFF">&nbsp;</td>
              </tr>
              <tr>
                <th scope="row">&nbsp;</th>
                    <td bgcolor="#FFFFFF">&nbsp;</td>
              </tr>
              <tr>
                <th scope="row">&nbsp;</th>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>  <?
                        }
                         ?>
              <tr>
                <th scope="row">&nbsp;</th>
                <td colspan="3" rowspan="6">
		<table width="561" border="0" align="left" cellpadding="0" cellspacing="0" bgcolor="#FFFFCC">
                  <tr>
                    <td width="75">รายละเอียด</td>
                    <td><div align="left"><span class="style4">
                      <textarea name="txtDetails" cols="50" rows="5" id="txtDetails"></textarea>
                    </span></div></td>
                  </tr>
                  <tr>
                    <td width="75">&nbsp;</td>
                    <td width="486">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>ชื่อ</td>
                    <td><input name="txtName" type="text" id="txtName" value="ADMIN" size="50" readonly="ADMIN"/></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td><input name="btnSave" type="submit" id="btnSave" value="Submit" /></td>		
                  </tr>
                </table>
		</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <th scope="row">&nbsp;</th>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <th scope="row">&nbsp;</th>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <th scope="row">&nbsp;</th>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <th scope="row">&nbsp;</th>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <th scope="row">&nbsp;</th>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <th scope="row">&nbsp;</th>
                <td>&nbsp;</td>
                <td><div align="left"><a href="../admin/manage_webboard.php"><img src="../images/Back.png" width="15" height="15" />กลับไปหน้าจัดการเว็บบอร์ด</a></div></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
</table>
</form>
</body>
</html>




Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-08-17 14:34:41 By : redkimono View : 733 Reply : 3
 

 

No. 1



โพสกระทู้ ( 3,748 )
บทความ ( 0 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์
Facebook

ลิงค์ตอนกลับอ่ะครับ มันเอาค่ามาด้วยหรือเปล่า $_GET["QuestionID"]






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-17 14:37:46 By : Dragons_first
 


 

No. 2



โพสกระทู้ ( 3,155 )
บทความ ( 0 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


Quote:
เพิ่มลงในโค้ดครับ
<td width="282" bgcolor="#FDDFA5">
<a href="JavaScript:if(confirm('ยืนยันการลบข้อมูล?')==true)
{window.location='Viewwebboard_Admin.php?Action=Del&ReplyID=<?=$objResult2["ReplyID"];?>&QuestionID=<?=$_GET["QuestionID"];?>';}">
<img src="../images/Delete.jpg" width="18" height="18" />
</a>
</td>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-17 14:52:39 By : sakuraei
 

 

No. 3



โพสกระทู้ ( 61 )
บทความ ( 0 )



สถานะออฟไลน์


เย้ ได้แล้วค่ะ ขอบคุณมากๆเลยนะคะ ขอบคุณทุกคนที่เข้ามาตอบ รักเว็บนี้จัง อิอิ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-17 17:53:30 By : redkimono
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : รบกวนอีกด้วยนะคะ คือว่าพอกดลบข้อมูลแล้วข้อมูลไม่แสดงค่ะ แต่ในฐานข้อมูลลบได้ตามข้อมูลที่เรากดลบ ไม่รู้เป็นเพราะอะไร แก้มาทั้งวันก็ยังไม่ได้ค่ะ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 01
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่