มือใหม่ช่วยหน่อยฮะ งง แสดงแบบ table -ขออีกทีครับ คนใจดีน้ำใจเซิญวิเคราะห์
<Code
?
$objConnect = mysql_connect("localhost","root","12345") or die("Error Connect to Database");
$objDB = mysql_select_db('webboard',$objConnect) or die("No Database select!!!");
$strSQL = "SELECT * FROM files";
$objQuery = mysql_query($strSQL) or die (mysql_error());
?>
<div align="center"></div>
<table width="455" border="1" cellpadding="2" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="28" colspan="5" class="pageName">รถดี มีคุณภาพ สำหรับคุณ</td>
</tr>
<tr>
<td height="38"> </td>
<td align="center" valign="top"><div align="center">
<p><img src="ViewImage.php?FilesID=<?=$objResult["FilesID"];?>" alt="" /></p>
</div></td>
ผมลองตัวนี้ภาพไม่ขึ้น
<td align="center" valign="top">
<p><img src="toyota/New Folder/soluna5581/5581small.jpg?FilesID=<?=$objResult["FilesID"];?>" alt="" /></p></td>
ผมลองเรียกผ่านตัวนี้โชว์
<td align="center" valign="top"><div align="center"><img src="toyota/New Folder/yaris4643/4643small.jpg?FilesID=<?=$objResult["FilesID"];?>" alt="" /></div></td>
<td width="30"> </td>
</tr>
<tr>
<td height="32" valign="top" nowrap="nowrap" class="detailText"> </td>
<td><span class="detailText"><a href="indexvigo4109.html">ยี่ห้อ : TOYOTA HILUX VIGO </a><br />
Price: ฿495,000 </span></td>
<td class="detailText" valign="top" nowrap="nowrap"><a href="indexsoluna5581.html">ยี่ห้อ : TOYOTA SOLUNA </a><br />
Price: ฿285,000 </td>
<td valign="top" nowrap="nowrap" class="detailText"><a href="indexaris4643.html">ยี่ห้อ : TOYOTA YARIS </a><br />
Price: ฿439,000 </td>
<td> </td>
</tr>
<tr>
<td height="18" colspan="5"></td>
</tr>
<tr>
<td height="38"> </td>
<td align="center" valign="top"><div align="center">
<p><img src="toyota/New Folder/jass6351/6351small.jpg?FilesID=<?=$objResult["FilesID"];?>" alt="" /></p>
</div></td>
<td align="center" valign="top"><div align="center"><img src="toyota/New Folder/Accord/Accord-small.jpg?FilesID=<?=$objResult["FilesID"];?>" alt="" /></div></td>
<td align="center" valign="top"><p><img src="toyota/New Folder/nissan1464/1464-nissan-small.jpg?FilesID=<?=$objResult["FilesID"];?>" alt="" /></p></td>
<td> </td>
</tr>
<tr>
<td height="32" valign="top" nowrap="nowrap" class="detailText"><a href="javascript:;"></a></td>
<td><span class="detailText"><a href="javascript:;"></a><a href="indexjass6351.html">ยี่ห้อ : HONDA JAZZ </a><br />
Price: ฿600,000</span></td>
<td class="detailText" valign="top" nowrap="nowrap"><a href="javascript:;"></a><a href="indexAccord.html">ยี่ห้อ : HONDA ACCORD </a><br />
Price: ฿620,000</td>
<td valign="top" nowrap="nowrap" class="detailText"><p><a href="mainnissan1464.php" target="_blank">ยี่ห้อ :NISSAN<strong> FRONTIER1-2<br />
</strong></a>Price: ฿630,000 </p></td>
<td> </td>
</tr>
<tr>
<td height="18" colspan="4"></td>
<td height="18"></td>
</tr>
<tr>
<td height="38"></td>
<td align="center" valign="top"><div align="center"><img src="toyota/New Folder/soluna5052/toyota5052-small.jpg?FilesID=<?=$objResult["FilesID"];?>" alt="" /></div></td>
<td align="center" valign="top"><div align="center"><img src="toyota/New Folder/toyota5703small.jpg?FilesID=<?=$objResult["FilesID"];?>" alt="" /></div></td>
<td align="center" valign="top"><div align="center"><img src="toyota/New Folder/vigo4467/toyota4467-small.jpg?FilesID=<?=$objResult["FilesID"];?>" alt="" /></div></td>
<td height="38"></td>
</tr>
<tr>
<td height="18"></td>
<td height="18"><span class="detailText"><a href="indexsoluna5052.html">ยี่ห้อ : TOYOTA SOLUNA </a><br />
Price: ฿225,000</span></td>
<td height="18"><span class="detailText"><a href="indexyaris5703.html">ยี่ห้อ : TOYOTA YARIS </a><br />
Price: ฿440,000 </span></td>
<td height="18"><span class="detailText"><a href="indexvigo4467.html">ยี่ห้อ : TOYOTA HILUX VIGO 4WD </a><br />
Price: ฿567,000 </span></td>
<td height="18"></td>
</tr>
<tr>
<td height="18" colspan="5"></td>
</tr>
<tr>
<td height="38"><p> </p>
</td>
<td align="center" valign="top"><p><img src="toyota/New Folder/yaris4643/4643small.jpg?FilesID=<?=$objResult["FilesID"];?>" alt="" /></p></td>
<td align="center" valign="top"><div align="center"><img src="toyota/New Folder/vios8428/soluna-vios-big8428-small.jpg?FilesID=<?=$objResult["FilesID"];?>" alt="" /></div></td>
<td align="center" valign="top"><div align="center"><img src="toyota/New Folder/tiger3437/toyota3437-small.jpg?FilesID=<?=$objResult["FilesID"];?>" alt="" /></div></td>
<td height="38"></td>
</tr>
<tr>
<td height="18"></td>
<td height="18"><span class="detailText"><a href="indexaris4643.html">ยี่ห้อ : TOYOTA YARIS <strong><br />
</strong></a>Price: ฿368,000 </span></td>
<td height="18"><span class="detailText"><a href="indexvios8428.html">ยี่ห้อ : TOYOTA VIOS (s) </a><br />
Price: ฿378,000</span></td>
<td height="18"><span class="detailText"><a href="indexsport3437.html">ยี่ห้อ : TOYOTA .SPORT CRUISER</a><br />
Price: ฿455,000 </span></td>
<td height="18"></td>
</tr>
<tr>
<td height="18" colspan="5"></td>
</tr>
</table>ผมอยากได้อย่างงี้ ครับ ช่วยด้วย ตอนผมยังไม่เก็บผ่าน appserv
ตอนนี้ย้ายมา ใช้database
Tag : PHP, MySQL
ประวัติการแก้ไข 2012-09-02 20:38:37 2012-09-02 22:43:53
Date :
2012-09-02 20:10:34
By :
maiaoy
View :
933
Reply :
3
ช่วยด้วย ๆ ๆ ๆ ๆ ๆ
Date :
2012-09-02 22:48:11
By :
maiaoy
ผมลงโหลด code ตย.ไปปรับใช้แล้วเป็น
Code (PHP)
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<body><html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<body>
<?
$objConnect = mysql_connect("localhost","root","12345") or die(mysql_error());
$objDB = mysql_select_db('webboard',$objConnect) or die("No Database select!!!");
$strSQL = "SELECT * FROM Files ";
$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="Myfile/<?=$objResult["FileName"];?>"><br>
<?=$objResult["Name"];?>
<br>
</center>
<?
echo"</td>";
if(($intRows)%2==0)
{
echo"</tr>";
}
}
echo"</tr></table>";
?>
</body>
</html>
<?
mysql_close($objConnect);
?>
</body>
</html>
ผลที่ออกมา
ใครก็ได้ดูให้หน่อยครับ นี่เป็น filed DB
ผมยากให้มันแสดงรูปอย่างงี้ครับ
ขอบคุณสำหรับทุกคำแนะนำครับ
ประวัติการแก้ไข 2012-09-03 18:09:38
Date :
2012-09-03 14:44:10
By :
mai
Load balance : Server 00