|
|
|
ทำ Image Photo Gallery แสดงภาพทั้งหมดที่มีใน Folder สามารถแทรกคำอธิบายได้ |
|
|
|
|
|
|
|
Code (PHP)
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<body>
<?
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("mydatabase");
$strSQL = "SELECT * FROM album";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
echo"<table border=\"1\" cellspacing=\"1\" cellpadding=\"1\"><tr>";
$intRows = 0;
while($objResult = mysql_fetch_array($objQuery))
{
echo "<td>";
$intRows++;
?>
<center>
<a href="show_gallery.php?AlbumID=<?=$objResult["AlbumID"];?>"><img src="myfile/<?=$objResult["AlbumShot"];?>" width="100" height="100"></a><br>
<?=$objResult["AlbumName"];?>
<br>
</center>
<?
echo"</td>";
if(($intRows)%3==0)
{
echo"</tr>";
}
}
echo"</tr></table>";
mysql_close($objConnect);
?>
</body>
</html>
Go to : PHP Create Album Images Gallery / jQuery Lightbox
|
|
|
|
|
Date :
2011-09-16 23:34:12 |
By :
tc |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|