<html> <head> <title>ThaiCreate.Com PHP & MySQL Tutorial</title> </head> <body> <? $objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database"); $objDB = mysql_select_db("mydatabase"); $strSQL = "SELECT * FROM customer"; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); ?> <table width="600" border="1"> <tr> <th width="91"> <div align="center">CustomerID </div></th> <th width="98"> <div align="center">Name </div></th> <th width="198"> <div align="center">Email </div></th> <th width="97"> <div align="center">CountryCode </div></th> <th width="59"> <div align="center">Budget </div></th> <th width="71"> <div align="center">Used </div></th> </tr> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <tr> <td><div align="center"><?=$objResult["CustomerID"];?></div></td> <td><?=$objResult["Name"];?></td> <td><?=$objResult["Email"];?></td> <td><div align="center"><?=$objResult["CountryCode"];?></div></td> <td align="right"><?=$objResult["Budget"];?></td> <td align="right"><?=$objResult["Used"];?></td> </tr> <? } ?> </table> <? mysql_close($objConnect); ?> </body> </html>
<table width="920" align="center" cellspacing="1" bordercolor="#FF9FAA"> <tr class="normal_font"> <td colspan="10" align="left" scope="row"><span class="style36">ข้อมูลธนาคารมีทั้งหมด <?php echo" ".mysql_num_rows($sqlquery);?> แห่ง <span class="style37">|</span> <a href="admin_home.php">หน้าหลัก</a> <span class="style37">|</span> <span class="style37">|</span> <a href="bank_add.php">เพิ่มธนาคาร </a><span class="style37">| |</span> <a href="report_bank.php">ออกรายงาน</a> <span class="style37">| </span></span></td> </tr> <tr align="center" bgcolor="#FF9FAA" class="normal_font"> <th width="67" scope="row">รหัส</th> <th width="143" scope="row">ชื่อธนาคาร </th> <th width="163" scope="row">เลขที่บัญชี</th> <th width="138" scope="row">ชื่อบัญชี </th> <th width="110" scope="row">สาขา</th> <th width="125" scope="row">จังหวัด </th> <th width="125" scope="row">ประเภทบัญชี</th> <th width="46" scope="row">รูป</th> <th width="39" scope="row">แก้ไข</th> <th width="39" scope="row">ลบ</th> </tr> <? $sql= "select * from tb_bank order by b_id"; $sqlquery=mysql_db_query($dbname,$sql); while($result= mysql_fetch_array($sqlquery)){ if($bg == "#F8FAEF") { //ส่วนของการ สลับสี $bg = "#D2DDD2"; } else { $bg = "#F8FAEF"; } ?> <? $id=$result['b_id']; $code=sprintf("B%04d",$id); $name=$result['b_name']; $num=$result['b_num']; $pname=$result['b_pname']; $major=$result['b_major']; $type=$result['b_type']; $img=$result['b_images']; $province=$result['b_province']; $sql2= "select * from tb_province where pro_id='$province'"; $sqlquery2=mysql_db_query($dbname,$sql2); $result2= mysql_fetch_array($sqlquery2); $provincename=$result2['pro_name']; ?> <tr align="center" bgcolor="<?=$bg?>" class="normal_font"> <td width="67" height="22" class="style33" scope="row"> <?=$code;?> </td> <td class="style33" scope="row"> <?=$name;?> </td> <td class="style33" scope="row"> <?=$num;?> </td> <td class="style33" scope="row"> <?=$pname;?> </td> <td class="style33" scope="row"> <?=$major;?> </td> <td class="style33" scope="row"><?=$provincename;?></td> <td class="style33" scope="row"> <?=$type;?> </td> <th scope="row"><img src="bank/<?=$img?>" width="20" height="20" border="0" /></th> <th scope="row"><a href="bank_edit.php?id=<?=$id;?>" class="style33"><img src="icon/tools-icon.png" width="15" height="15" border="0" /></a></th> <th scope="row"><a href="script_bank_delete.php?id=<?=$id;?>&photo_del=<?=$img;?>" class="style33"onclick="return confirm ('ยืนยันการลบข้อมูลธนาคาร <?=$name?> ออกจากระบบ')"><img src="icon/delete.gif" width="15" height="15" border="0" /></a></th> <? } ?> </tr> </table>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง