<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="style.css" rel="stylesheet" type="text/css"/> <table width="1250" align="center" class="square"> <tr> <td colspan="7" align="center"><a href="addform.php">AddData</a></td> </tr> <tr bgcolor="#A8A8A8"> <td width="70" align="center"><strong>IDCODE</strong></td> <td width="350" align="center"><strong>NAMEBOOK</strong></td> <td width="165" align="center"><strong>STUDENT</strong></td> <td width="165" align="center"><strong>ADVISOR</strong></td> <td width="165" align="center"><strong>SPECIAL</strong></td> <td width="70" align="center"><strong>GRADE</strong></td> <td width="90" align="center"><strong>ABSTRACT</strong></td> <td width="60" align="center"><strong>EBOOK</strong></td> <td width="50" align="center"><strong>EDIT</strong></td> <td width="65" align="center"><strong>DELETE</strong></td> </tr> <?php // 1. เชิ่อมต่อเชิพเวอร์ mysql $conn = mysql_connect ("localhost","root","1234")or die(mysql_error ()); // 2. เลือกฐานข้อมูลที่ต้องการใ้ชงาน $db = mysql_select_db ("sp") or die ("cannot select DB") ; mysql_query("SET NAMES UTF8"); // 3. นำคำสั่ง sql ไปทำการประมาวลผลที่ฐานข้อมูล $sql ="select * from sp" ; $query = mysql_query ($sql) or die ("error=$sql"); // 4. นับจำนวนข้อมูลที่เรียกขึ้นมาจากฐานข้ิอมูล $num = mysql_num_rows ($query); // 5. นำข้อมูลขึ้นมาแสดงบนหน้าเว็บเพจ for($i=1;$i<=$num;$i++) { $row = mysql_fetch_array($query); //นำข้อมูลออกมาทีละเรคคอร์ดเก็บไว้ใน array ?> <tr> <td><?php echo $row['id']?></td> <td><?php echo $row[1] ?></td> <td><?php echo $row[2] ?></td> <td><?php echo $row[3] ?></td> <td><?php echo $row[4] ?></td> <td><?php echo $row[5] ?></td> <td> <a href="myfile/<?=$objResult["abs"];?>"><?=$objResult["FilesName"];?></td> <td ><a href="myfile/<?=$objResult["ebo"];?>"><?=$objResult["FilesName"];?></td> <td><a href="editform.php?id=<?php echo $row['id'] ?>">edit</a></td> <td><a href="delete.php?id=<?php echo $row['id'] ?>" onclick="return confirm('are u sure??');">delete</a></td> </tr> <?php } // 6. ปิดการเช่ื่อมต่อ mysql_close (); ?> </table>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง