<table width="566" border="0" cellspacing="0" cellpadding="0" height="475">
<tr>
<td align="left" valign="top" width="43" height="421"><img src="images/logo_bot_r.gif" width="43" height="82"></td>
<td width="558" align="right" valign="top" height="421">
<?
$dbconn = @mysql_connect("localhost", "root") or exit("SERVER Unavailable");
$dbname="photos";
@mysql_select_db($dbname,$dbconn) or exit("DB Unavailable");
$sql = "SELECT filename FROM photos_pictures Where aid = '2' order by pid LIMIT 4 ";
$result = @($sql,$dbconn) or exit("QUERY FAILED!");
echo "<table width=280 border=0 cellspacing=12 cellpadding=1 height=150>\n";
echo "<tr><td colspan=4>Click on each image for a larger view</td></tr><tr valign=top>\n";
while ($rs=mysql_fetch_array($result)) {
echo "<td height=2 width=70 height=100><img src=\"backend/albums/thumb_".$rs[0]."\" class=image width=70 height=100 border=0></td>";
};
echo "</tr></table>\n";
mysql_close($dbconn);
?>
</td>
</tr>
</table>
Hi,
I've been trying to setup a php page to call images from a photo gallery by calling the MySQL tables associated
with it. I have managed to get the images to appear and can set the order, number of images etc. What I can't
do is format the TABLE to make the images appear in a specific way such as having a row of 4 images
and then starting another row of 4 beneath it and so on. The loop above will display the images on after
another either all the way across of all the way down.
Any suggestions??