Hello, I have this site and I want to display wallpapers in ROWS and COLUMNS,
with PHP, it only shows stuff in rows right?
Like it goes
1
2
3
4
5
6
I want it go to
1 2 3
4 5 6
7 8 9
Well, I found a way around it and the code is messy... and I dont even know if its right... does anyone have a better idea how to do it?
heres what I have
<? include("../Overall-Header.php"); ?>
<?
$sql = mysql_query("SELECT filename, width, height FROM site_wallpapers_index");
ECHO "<TABLE CLASS=\"NO-BORDER\">";
$i = 1;
while ($row = mysql_fetch_array($sql)) {
$Filename = $row['filename'];
$width = $row['width'];
$height = $row['height'];
$ShowWallpaper = "<TD ALIGN=\"CENTER\" BACKGROUND=\"../Layout/Version 6/ThumbnailBG.gif\" width=117 height=96><A HREF=\"Wallpapers/$Filename.jpg\"><IMG SRC=\"Wallpapers/TN$Filename.jpg\" STYLE=\"MARGIN-TOP:9px; MARGIN-LEFT:0px; MARGIN-BOTTOM:5px\" BORDER=0 width=100 height=75></A><BR>$width x $height</TD>";
if ($i == 1) { ECHO "<TR>$ShowWallpaper"; }
else if ($i == 2) { ECHO "$ShowWallpaper"; }
else if ($i == 3) { ECHO "$ShowWallpaper</TR>"; }
else if ($i == 4) { ECHO "<TR>$ShowWallpaper";}
else if ($i == 5) { ECHO "$ShowWallpaper"; }
else if ($i == 6) { ECHO "$ShowWallpaper</TR>";}
else if ($i == 7) { ECHO "<TR>$ShowWallpaper";}
else if ($i == 8) { ECHO "$ShowWallpaper"; }
else if ($i == 9) { ECHO "$ShowWallpaper</TR>";}
else if ($i == 10) { ECHO "<TR>$ShowWallpaper";}
else if ($i == 11) { ECHO "$ShowWallpaper"; }
else if ($i == 12) { ECHO "$ShowWallpaper</TR>";}
else if ($i == 13) { ECHO "<TR>$ShowWallpaper";}
else if ($i == 14) { ECHO "$ShowWallpaper"; }
else if ($i == 15) { ECHO "$ShowWallpaper</TR>";}
else if ($i == 16) { ECHO "<TR>$ShowWallpaper";}
else if ($i == 17) { ECHO "$ShowWallpaper"; }
else if ($i == 18) { ECHO "$ShowWallpaper</TR>";}
else if ($i == 19) { ECHO "<TR>$ShowWallpaper";}
else if ($i == 20) { ECHO "$ShowWallpaper"; }
else if ($i == 21) { ECHO "$ShowWallpaper</TR>";}
else if ($i == 22) { ECHO "<TR>$ShowWallpaper";}
else if ($i == 23) { ECHO "$ShowWallpaper"; }
else if ($i == 24) { ECHO "$ShowWallpaper</TR>";}
else {}
$i++;
}
ECHO "$Content";
ECHO "</TABLE>";
?>
<? include("../Overall-Footer.php"); ?>
heres the link to the page if you guys want to see what I mean
http://www.ffcrystals.limited-chaos.com/FFIX/FFIXWallpapers.php