captainjustin
05-05-2010, 12:10 AM
Once again I'm stuck! I have a script that displays pictures by retrieving the picture names from my database. It works just fine but I would like to display 3 pictures per row. The code I have displays only one picture per row. I'm still very new to php and need a little more guidance than others so, any help would be greatly appreciated. Thanks in advance, Justin
<?
include_once "index.php";
$sb = "select * from my_pics";
$rsb = mysql_query($sb) or die(mysql_error());
if(mysql_num_rows($rsb) > '0')
{
echo "<table align=center width=470><caption align=center><b>Photo Album Control</b></caption><tr><br><td colspan=2><hr width=100% height=1px color=#000099></td></tr>";
while($ab = mysql_fetch_array($rsb))
{
echo " <table align=center width=120 border=1 cellspacing=0 bordercolor=black class=BlackText>
<tr style=\"background-color:#999999; font-family:verdana; font-size:11; font-weight:bold; color:white\">\n\t<td width=120 align=center>Posted by: $ab[by]<br>Date: $ab[date]</td>\n\t\n\t</tr>
<tr style=\"background-color:#dddddd\">
<td align=center width=120><a href=\"http://$_SERVER[HTTP_HOST]$dir/photo_album/$ab[fn]\" rel=\"lightbox\" title=\"The Picture\"><img src=\"http://$_SERVER[HTTP_HOST]$dir/photo_album/$ab[fn]\" width=\"120\" height=\"100\" /></a></</td></tr>
<tr> <td><a href=del_pic.php?b_id=$ab[b_id]&fn=$ab[fn]><center>Delete</center></a></td>
</tr>
</tr>
</table>
<br>";
}
//echo "</td></tr></table><br><br>";
}
else
{
echo "<br><br><center><span class=BlackLink>No pictures are listed at this time. <br><br>To Post One</span><br><br><a class=TNA href=upload_pics.php><center><b>click here.</b></center></a><br> </center>";
}
include_once('../footer.php');
?>
<?
include_once "index.php";
$sb = "select * from my_pics";
$rsb = mysql_query($sb) or die(mysql_error());
if(mysql_num_rows($rsb) > '0')
{
echo "<table align=center width=470><caption align=center><b>Photo Album Control</b></caption><tr><br><td colspan=2><hr width=100% height=1px color=#000099></td></tr>";
while($ab = mysql_fetch_array($rsb))
{
echo " <table align=center width=120 border=1 cellspacing=0 bordercolor=black class=BlackText>
<tr style=\"background-color:#999999; font-family:verdana; font-size:11; font-weight:bold; color:white\">\n\t<td width=120 align=center>Posted by: $ab[by]<br>Date: $ab[date]</td>\n\t\n\t</tr>
<tr style=\"background-color:#dddddd\">
<td align=center width=120><a href=\"http://$_SERVER[HTTP_HOST]$dir/photo_album/$ab[fn]\" rel=\"lightbox\" title=\"The Picture\"><img src=\"http://$_SERVER[HTTP_HOST]$dir/photo_album/$ab[fn]\" width=\"120\" height=\"100\" /></a></</td></tr>
<tr> <td><a href=del_pic.php?b_id=$ab[b_id]&fn=$ab[fn]><center>Delete</center></a></td>
</tr>
</tr>
</table>
<br>";
}
//echo "</td></tr></table><br><br>";
}
else
{
echo "<br><br><center><span class=BlackLink>No pictures are listed at this time. <br><br>To Post One</span><br><br><a class=TNA href=upload_pics.php><center><b>click here.</b></center></a><br> </center>";
}
include_once('../footer.php');
?>