<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=tis-620"> <title>:: Script การติดต่อฐานข้อมูล เพื่อ เพิ่ม/ลบ/แก้ไข/ค้นคืน ข้อมูล ::</title> <style> BODY { FONT-FAMILY: Arial, Helvetica, sans-serif } </style> <script Language="Javascript"> <!-- function Conf(object) { if (confirm("โปรดยืนยันการลบ ?") == true) { return true; } return false; } //--> </script> </head> <body> <p align="center"> <font size="3"><< <a href="index.php">หน้าหลัก</a> >> <font size="3"><< <a href="showdataPP.php">เรียกดูข้อมูลในฐานข้อมูล</a> >> << <a href="php_multiple_upload1">เพิ่มข้อมูลลงฐานข้อมูล</a> >></font></p> <p align="center"><u><b><font size="5" color="#800000"> แสดงข้อมูลในฐานข้อมูล</font></b></u></p> <center> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="54%" id="AutoNumber1"> <tr> <td width="10%" bgcolor="#CCFFFF" align="center"> <b><font color="#000080">ID</font></b></td> <td width="24%" bgcolor="#CCFFFF" align="center"> <p align="center"><strong><font color="#000080">หัวข้อ</font></strong></td> <td width="30%" bgcolor="#CCFFFF" align="center"><b> <font color="#000080">รายละเอียด</font></b></td> <td width="19%" bgcolor="#CCFFFF" align="center"><b> <font color="#000080">แก้ไข</font></b></td> <td width="17%" bgcolor="#CCFFFF" align="center"><b> <font color="#000080">ลบ</font></b></td> </tr> <?php include("config.inc.php"); // คำสั่ง SQL ที่ใช้ในการเลือกข้อมูลที่อยู่ในฐานข้อมูลกลับมา (เรียงตามลำดับ ID) $result = mysql_query("select * from gallery order by GalleryID"); /* ในลูปด้านล่าง เทียบได้กับการดึงข้อมูลมาทีละ 1 Record เพื่อนำมาแสดงผลทางหน้าจอ */ while($dbarr = mysql_fetch_array($result)) { ?> <tr> <td width="10%" bgcolor="#CCCCFF" align="center"><?php echo $dbarr['GalleryID'] ; ?></td> <td width="24%" bgcolor="#CCCCFF" align="center"><?php echo $dbarr['GalleryName'] ; ?></td> <td width="30%" bgcolor="#CCCCFF" align="center"><?php echo $dbarr['Picture'] ; ?></td> <td width="19%" bgcolor="#CCCCFF" align="center"><center><a href="#"><img src="images/edit.gif" width="15" height="15" border="0"></a></center></td> <td width="17%" bgcolor="#CCCCFF" align="center"><center><a href="deletedataPP.php?del_GalleryID=<?=$row_show[GalleryID]?>>" OnClick="return Conf(this)"><img src="images/delete.jpg" width="16" height="15" border="0"></a></center></td> </tr> <?php } ?> </table> </center> </body> </html>
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=tis-620"> <title>:: Script การติดต่อฐานข้อมูล เพื่อ เพิ่ม/ลบ/แก้ไข/ค้นคืน ข้อมูล ::</title> <style> BODY { FONT-FAMILY: Arial, Helvetica, sans-serif } </style> </head> <body> <p align="center"> <font size="3"><< <a href="index.php">หน้าหลัก</a> >> <font size="3"><< <a href="showdataPP.php">เรียกดูข้อมูลในฐานข้อมูล</a> >> << <a href="php_multiple_upload1.php">เพิ่มข้อมูลลงฐานข้อมูล</a> >></font></p> <? include "config.inc.php"; $GalleryID = $_GET['GalleryID']; $sql = "delete from gallery where GalleryID=$GalleryID"; $result = mysql_query($sql); if($result) { echo "<center> <table border=\"1\" style=\"border-style:dotted; border-collapse: collapse; padding-left:4; padding-right:4; padding-top:1; padding-bottom:1\" bordercolor=\"#111111\" width=\"50%\" GalleryID=\"AutoNumber1\" height=\"138\"> <tr> <td height=\"136\"> <center> <font size=\"5\" color=\"#000080\">การลบสำเร็จ !!</font><br><br> <font size=\"4\"><a href=\"showdataPP.php\">ตกลง</a></font> </center> </td> </tr> </table> </center>"; } else { echo "<center> <table border=\"1\" style=\"border-style:dotted; border-collapse: collapse; padding-left:4; padding-right:4; padding-top:1; padding-bottom:1\" bordercolor=\"#111111\" width=\"50%\" GalleryID=\"AutoNumber1\" height=\"138\"> <tr> <td height=\"136\" bgcolor=\"#FFCCFF\"> <center> <font size=\"5\" color=\"#000080\">การลบล้มเหลว !!</font><br><br> <font size=\"4\"><a href=\"showdataPP.php\">ตกลง</a></font> </center> </td> </tr> </table> </center>"; } ?> </body> </html>
<a href="deletedataPP.php?del_GalleryID=<?=$row_show[GalleryID]?>>" OnClick="return Conf(this)"><img src="images/delete.jpg" width="16" height="15" border="0"></a>
<a href="deletedataPP.php?del_GalleryID=<?=$dbarr[GalleryID]?>" OnClick="return Conf(this)"><img src="images/delete.jpg" width="16" height="15" border="0"></a>
$GalleryID = $_GET['GalleryID']; //เปลี่ยนเป็น $GalleryID = $_GET['del_GalleryID'];
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง