include"../../../lib/soulg/m/k/conn.php"; $objConnect = mysql_connect("$host","$user","$pass") or die("Error Connect to Database"); mysql_query("SET NAMES UTF8"); $objDB = mysql_select_db("$dataseed"); $command = "SELECT * FROM tb_soul"; /** * get object result from database */ $result = mysql_query($command); <table width="550" style="border-collapse:collapse" bordercolor="#00CC00" border="1"> <tr> <th bgcolor="#006600"><font color="#FFFFFF" size="2">๒๒๒๒๒๒</font></th> <th bgcolor="#006600"><font color="#FFFFFF" size="2">๒๒๒๒๒๒</font></th> <th bgcolor="#006600"><font color="#FFFFFF" size="2">๒๒๒๒๒๒</font></th> <th bgcolor="#006600"><font color="#FFFFFF" size="2">๒๒๒๒๒๒</font></th> <th bgcolor="#006600"><font color="#FFFFFF" size="2">๒๒๒๒๒๒</font></th> <th bgcolor="#006600"><font color="#FFFFFF" size="2">๒๒๒๒๒๒</font></th> </tr> <tr> <? while($objResult3 = mysql_fetch_array($result)) { $id_rice=$objResult3['id_rice']; $name_rice=$objResult3['name_rice']; $number=$objResult3['number']; $unit=$objResult3['unit']; $date_old=$objResult3['date_old']; $date_new=$objResult3['date_new']; $time=$objResult3['time']; echo "<td><span><center>$id_rice</center></span></td>"; echo "<td><span>$name_rice</span></td>"; echo "<td><span><center>$number</center></span></td>"; echo '<td><span><center><font color="#009900" size="2">'.$objResult3['unit'].'</font></center></span></td>'; echo '<td><span><font color="#009900" size="2">'.$objResult3['date_old'].'</font></span></td>'; echo "<td><span><font color='#009900' size='2'> $date_new $time</font></span></td>"; echo '</tr>'; } echo"</table>";
<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>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง