//*** Select Old File ***// $strSQL = "SELECT * FROM webboard WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $objResult = mysql_fetch_array($objQuery); //*** Delete Rows ***// $strSQL = " DELETE FROM webboard "; $strSQL .=" WHERE QuestionID = '".$_GET["QuestionID"]."'"; $objQuery = mysql_query($strSQL); //*** Loop Delete Reply ***// $strSQL2 = "SELECT * FROM reply WHERE ReplyID = '".$_GET["ReplyID"]."'"; $objQuery2 = mysql_query($strSQL2) or die ("Error Query [".$strSQL2."]"); while($objResult2 = mysql_fetch_array($objQuery2)) //*** Delete All Rows (REply)***// $strSQL = " DELETE FROM reply "; $strSQL .=" WHERE ReplyID = '".$_GET["ReplyID"]."' "; $objQuery = mysql_query($strSQL); echo "Delete Complete"; mysql_close($objConnect); ?> <a href="webboard-admin.php"><br>View Files</a> </body>
<?php //*** Select Old File ***// $strSQL = "SELECT * FROM webboard WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery = mysql_query($strSQL)or die(mysql_error()); $objResult = mysql_fetch_array($objQuery); //*** Delete Rows ***// $strSQL = " DELETE FROM webboard "; $strSQL .=" WHERE QuestionID = '".$_GET["QuestionID"]."'"; $objQuery = mysql_query($strSQL); //*** Loop Delete Reply ***// $strSQL2 = "SELECT * FROM reply WHERE ReplyID = '".$_GET["ReplyID"]."'"; $objQuery2 = mysql_query($strSQL2) or die ("Error Query [".$strSQL2."]"); while($objResult2 = mysql_fetch_array($objQuery2)) // ตรงนี้จะทำอะไรครับ //*** Delete All Rows (REply)***// $strSQL = " DELETE FROM reply "; $strSQL .=" WHERE ReplyID = '".$_GET["ReplyID"]."' "; $objQuery = mysql_query($strSQL); echo "Delete Complete"; mysql_close($objConnect); ?>
mysql_query($strSQL) or die(mysql_error());
<?php $strSQL = "DELETE FROM reply "; $strSQL .="WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery = mysql_query($strSQL)or die(mysql_error()); if($objQuery) { echo "Record Deleted."; $strSQL = "DELETE FROM webboard "; $strSQL .="WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery = mysql_query($strSQL)or die(mysql_error()); if($objQuery) { echo "Record Deleted."; } else { echo "Error Delete [".$strSQL."]"; } } else { echo "Error Delete [".$strSQL."]"; } ?>
$strSQL = "DELETE FROM reply "; $strSQL .="WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery = mysql_query($strSQL)or die(mysql_error()); if($objQuery) { echo "Record Deleted."; } else { echo "Error Delete [".$strSQL."]"; } $strSQL2 = "DELETE FROM webboard "; $strSQL2 .="WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery2 = mysql_query($strSQL2 )or die(mysql_error()); if($objQuery2 ) { echo "Record Deleted."; } else { echo "Error Delete [".$strSQL."]"; }
<body> <? $objConnect = mysql_connect("localhost","root","12345") or die(mysql_error()); $objDB = mysql_select_db("webboard"); //*** Select Old File ***// $strSQL = "SELECT * FROM webboard WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $objResult = mysql_fetch_array($objQuery); //*** Delete Rows ***// $strSQL = " DELETE FROM webboard "; $strSQL .=" WHERE QuestionID,CreateDate,Question,Detial,Name,View = '".$_GET["QuestionID"]."'"; $objQuery = mysql_query($strSQL); //*** Loop Delete Reply ***// $strSQL2 = "SELECT * FROM reply WHERE ReplyID '".$_GET["ReplyID"]."'"; $objQuery2 = mysql_query($strSQL2) or die ("Error Query [".$strSQL2."]"); while($objResult2 = mysql_fetch_array($objQuery2)) //*** Delete All Rows (REply)***// $strSQL = " DELETE FROM reply "; $strSQL .=" WHERE ReplyID = '".$_GET["ReplyID"]."' "; $objQuery = mysql_query($strSQL); echo "Delete Complete"; mysql_close($objConnect); ?> <a href="webboard-admin.php"><br>View Files</a> </body> </html>
<body> <? $objConnect = mysql_connect("localhost","root","12345") or die(mysql_error()); $objDB = mysql_select_db("webboard"); $strSQL = "DELETE FROM reply "; $strSQL .="WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery = mysql_query($strSQL)or die(mysql_error()); if($objQuery) { echo "Record Deleted."; } else { echo "Error Delete [".$strSQL."]"; } $strSQL2 = "DELETE FROM webboard "; $strSQL2 .="WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery2 = mysql_query($strSQL2 )or die(mysql_error()); if($objQuery2 ) { echo "Record Deleted."; } else { echo "Error Delete [".$strSQL."]"; } mysql_close($objConnect); ?> <a href="webboard-admin.php"><br>View Files</a> </body> </html>
<? $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); ?> <table width="656" border="1" cellpadding="1" cellspacing="1"> <tr bgcolor="#00FFFF"> <td colspan="2"><center><h1><?=$objResult["Question"];?></h1></center></td> </tr> <tr> <td height="53" colspan="2"><?=$objResult["Details"];?></td> </tr> <tr bgcolor="#99FFFF"> <td width="442">ชื่อ : <?=$objResult["Name"];?> วันที่โพส : <?=$objResult["CreateDate"];?></td> <td width="244">ดู : <?=$objResult["View"];?> ตอบกลับ : <?=$objResult["Reply"];?></td> </tr> </table> <div align="center"><br> <br> <br> <? $intRows = 0; $strSQL2 = "SELECT * FROM reply WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery2 = mysql_query($strSQL2) or die ("Error Query [".$strSQL."]"); while($objResult2 = mysql_fetch_array($objQuery2)) { $intRows++; ?> <div align="left"> <table width="331" border="0"> <tr> <th scope="col"><div align="center">ความเห็นที่ : <?=$intRows;?></th> </div> </tr> </table></div> <table width="650" border="1" cellpadding="1" cellspacing="1"> <tr> <td height="53" colspan="2"><?=nl2br($objResult2["Details"]);?></td> </tr> <tr bgcolor="#33FF99"> <td width="442">ชื่อ : <?=$objResult2["Name"];?> </td> <td width="195">วันที่ตอบ : <?=$objResult2["CreateDate"];?></td> </tr> </table> <a href="JavaScript:if(confirm('ยืนยันการลบคำตอบ?')==true){window.location='DeleteReply.php?ReID=<?=$objResult2["ReplyID"];?>';}"><img src="images/Symbol-Delete.png" width="23" height="20" /></a></td> [ ลบคำตอบ ]</a><br><br /></div> <div align="center"> <? } ?> <br> <br> <a href="Webboard.php">กลับสู่หน้าเว็บบอร์ด</a> <br> <br> </div> <form action="Admindelete_reply.php?QuestionID=<?=$_GET["QuestionID"];?>&Action=Save" method="post" name="frmMain" id="frmMain"> <table width="657" border="1" cellpadding="1" cellspacing="1"> <tr> <td width="78">ข้อความ</td> <td><textarea name="txtDetails" cols="50" rows="5" id="txtDetails"></textarea></td> </tr> <tr> <td width="78">ชื่อ</td> <td width="576"><input name="txtName" type="text" id="txtName" value="" size="50"></td> </tr> </table> <input name="btnSave" type="submit" id="btnSave" value="ตอบกลับ"> </form> </div>
<? $objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database"); $objDB = mysql_select_db("Studentwbi"); $strSQL = "DELETE FROM reply "; $strSQL .="WHERE ReplyID = '".$_GET["ReID"]."' "; $objQuery = mysql_query($strSQL); if($objQuery) { echo "<script langquage='javascript'>alert('Delete Complete !!');</script>"; echo "<script langquage='javascript'>window.location='Admin_webboard.php';</script>"; } else { echo "<script langquage='javascript'>alert('Cannot Delete! Please again');</script>"; echo "<script langquage='javascript'>window.location='Admin_webboard.php';</script>"; } mysql_close($objConnect); ?>
<? $objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database"); $objDB = mysql_select_db("Studentwbi"); $strSQL = "DELETE FROM webboard "; $strSQL .="WHERE QuestionID = '".$_GET["QID"]."' "; $objQuery = mysql_query($strSQL); if($objQuery) { echo "<script langquage='javascript'>alert('Delete Complete !!');</script>"; echo "<script langquage='javascript'>window.location='Admin_webboard.php';</script>"; } else { echo "<script langquage='javascript'>alert('Cannot Delete! Please again');</script>"; echo "<script langquage='javascript'>window.location='Admin_webboard.php';</script>"; } mysql_close($objConnect); ?>
<? $objConnect = mysql_connect("localhost","root","12345") or die("Error Connect to Database"); $objDB = mysql_select_db("webboard"); $strSQL = "DELETE FROM webboard "; $strSQL .="WHERE QuestionID = '".$_GET["QID"]."' "; $objQuery = mysql_query($strSQL); if($objQuery) { echo "<script langquage='javascript'>alert('Delete Complete !!');</script>"; echo "<script langquage='javascript'>window.location='webboard-admin.php';</script>"; } else { echo "<script langquage='javascript'>alert('Cannot Delete! Please again');</script>"; echo "<script langquage='javascript'>window.location='webboard-admin.php';</script>"; } $strSQL = "DELETE FROM reply "; $strSQL .="WHERE ReplyID = '".$_GET["ReID"]."' "; $objQuery = mysql_query($strSQL); if($objQuery) { echo "<script langquage='javascript'>alert('Delete Complete !!');</script>"; echo "<script langquage='javascript'>window.location='webboard-admin.php';</script>"; } else { echo "<script langquage='javascript'>alert('Cannot Delete! Please again');</script>"; echo "<script langquage='javascript'>window.location='webboard-admin.php';</script>"; } mysql_close($objConnect); ?> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง