<html> <head> <title>ThaiCreate.Com Tutorial</title> </head> <body> <? $objConnect = mysql_connect("localhost","root","root") or die(mysql_error()); $objDB = mysql_select_db("mydatabase"); $strSQL = "SELECT * FROM gallery"; $objQuery = mysql_query($strSQL); echo"<table border=\"1\" cellspacing=\"1\" cellpadding=\"1\"><tr>"; $intRows = 0; while($objResult = mysql_fetch_array($objQuery)) { echo "<td>"; $intRows++; ?> <center> <img src="thaicreate/<?=$objResult["Picture"];?>"><br> <?=$objResult["GalleryName"];?> <br> </center> <? echo"</td>"; if(($intRows)%2==0) { echo"</tr>"; } } echo"</tr></table>"; ?> </body> </html> <? mysql_close($objConnect); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>Untitled Document</title> </head> <body> <? include" config.php"; $strSQL = "SELECT * FROM tb_news"; $objQuery = mysql_query($strSQL); echo"<table border=\"1\" cellspacing=\"1\" cellpadding=\"1\"><tr>"; $intRows = 0; while($objResult = mysql_fetch_array($objQuery)) { echo "<td>"; $intRows++; ?> <center> <img src="thaicreate/<?=$objResult["Picture"];?>"><br> <?=$objResult["GalleryName"];?> <br> </center> <? echo"</td>"; if(($intRows)%2==0) { echo"</tr>"; } } echo"</tr></table>"; ?> </body> </html> <? mysql_close($objConnect); ?>
<html> <head> <title></title> </head> <body> <? $strSQL = "SELECT * FROM tb_news"; $objQuery = mysql_query($strSQL); echo"<table border=\"1\" cellspacing=\"1\" cellpadding=\"1\"><tr>"; $intRows = 0; while($objResult = mysql_fetch_array($objQuery)) { echo "<td>"; $intRows++; ?> <center> <img src="thaicreate/<?=$objResult["Picture"];?>"><br> <?=$objResult["GalleryName"];?> <br> </center> <? echo"</td>"; if(($intRows)%2==0) { echo"</tr>"; } } echo"</tr></table>"; ?> </body> </html>
<html> <head> <title></title> </head> <body> <? include" config.php"; // เรียก file connect database ของเรามา $strSQL = "SELECT * FROM tb_news"; $objQuery = mysql_query($strSQL); echo"<table border=\"1\" cellspacing=\"1\" cellpadding=\"1\"><tr>"; $intRows = 0; while($objResult = mysql_fetch_array($objQuery)) { echo "<td>"; $intRows++; ?> <center> <img src="ชื่อfolderที่เก็บรูปภาพ/<?=$objResult["photo_news"];?>"><br> <?=$objResult["title_news"];?> <br> </center> <? echo"</td>"; if(($intRows)%2==0) { echo"</tr>"; } } echo"</tr></table>"; ?> </body> </html>
<html> <head> <title></title> </head> <body> <? include"connect.php"; $strSQL = "SELECT * FROM tb_news"; $objQuery = mysql_query($strSQL); echo"<table border=\"1\" cellspacing=\"1\" cellpadding=\"1\"><tr>"; $intRows = 0; while($objResult = mysql_fetch_array($objQuery)) { echo "<td>"; $intRows++; ?> <center> <img src="photo/<?=$objResult["Picture"];?>"><br> <?=$objResult["GalleryName"];?> <br> </center> <? echo"</td>"; if(($intRows)%2==0) { echo"</tr>"; } } echo"</tr></table>"; ?> </body> </html>
<html> <head> <title></title> </head> <body> <? include" connect.php"; ?> <? $strSQL = "SELECT * FROM tb_news"; $objQuery = mysql_query($strSQL); echo"<table border=\"1\" cellspacing=\"1\" cellpadding=\"1\"><tr>"; $intRows = 0; while($objResult = mysql_fetch_array($objQuery)) { echo "<td>"; $intRows++; ?> <center> <img src="photo/<?=$objResult["photo_news"];?>"><br> <?=$objResult["title_news"];?> <br> </center> <? echo"</td>"; if(($intRows)%2==0) { echo"</tr>"; } } echo"</tr></table>"; ?> </body> </html>
<? # Database - Start $db_HostName = "localhost"; $db_Name = "db_shop"; // database name $db_UserName = "root"; // username $db_Password = "1234"; // password $link = mysql_connect($db_HostName , $db_UserName , $db_Password) or die ("Cannot connect to database '$db_Name' : ".mysql_error()); mysql_select_db ($db_Name); mysql_query("SET character_set_results=tis620"); mysql_query("SET character_set_client=tis620"); mysql_query("SET character_set_connection=tis620"); # Database - End ?>
<html> <head> <title></title> </head> <body> <? include"connect.php"; ?> <? $strSQL = "SELECT * FROM tb_news"; $objQuery = mysql_query($strSQL); echo"<table border=\"1\" cellspacing=\"1\" cellpadding=\"1\"><tr>"; $intRows = 0; while($objResult = mysql_fetch_array($objQuery)) { echo "<td>"; $intRows++; ?> <center> <img src="photo/<?=$objResult["photo_news"];?>"><br> <?=$objResult["title_news"];?> <br> </center> <? echo"</td>"; if(($intRows)%2==0) { echo"</tr>"; } } echo"</tr></table>"; ?> </body> </html>
<table width="500" height="139" border="0" cellpadding="0" cellspacing="2"> <tr> <td width="125" height="42"> </td> <td width="125"> </td> <td width="125"> </td> <td width="125"> </td> </tr> </table> <table width="500" border="0" cellspacing="2" cellpadding="0"> <?php $i=1; $q="SELECT * FROM tb_news "; $qr=mysql_query($q); $numItem=mysql_num_rows($qr); $numCol=4; $remainCol=$numCol-($numItem%$numCol); while($rs=mysql_fetch_array($qr)){ ?> <?php if($i%$numCol==1){ ?> <tr> <td width="125"><?=$rs['title_news']?></td> <?php } ?> <?php if($i%$numCol==2){ ?> <td width="125"><?=$rs['tedail_news']?></td> <?php } ?> <?php if($i%$numCol==3){ ?> <td width="125"><?=$rs['date_news']?></td> <?php } ?> <?php if($i%$numCol==0){ ?> <td width="125"><?=$rs['time_news']?></td> </tr> <?php } ?> <?php $i++; } ?> <?=($remainCol>0 && $remainCol!=$numCol)?"<td colspan=".$remainCol."></td></tr>":""?> </table>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง