I am trying to get a multi column to work. I am trying to display product info in 3 columns instead of just in a row. I have had previous help with this and this is as far as I can get it to work. I think I have the info that is needed but the problem is that it querys 9 items even though there are only 6 and it only will grab one item either the last item or item 2. Depending where I place the while statement determines what info is grabed. If I have it has I have it now, it will grab the #2 item with all the right info, but it just repeats that one item 9 times (www.madewithcare.ws/baskets/baskets.php?HeaderID=7) you can see what I mean if you go to this link. If I move the while statement somewhere else it will grad the last item, but only display the price and nothing else.
Is this the easiest way to get a multi column display and if so, what am I missing. Below is the code. I appreciate your help.
Brett
<?
$db_name = "madewithcare_ws";
$table_x = "Baskets";
$connection = @mysql_connect("localhost", "crafts", "8kksDR4t") or die("Couldn't connect");
$db = @mysql_select_db($db_name, $connection) or die("couldn't select database");
$query = "SELECT *
FROM $table_x
ORDER BY BasketName";
$result = mysql_query($query);
$num=mysql_numrows($result);
$col=3;
$total=$num/$col;
for($count=1; $count<=$col; $count++) {
echo"<td nowrap width=\"33%\" align=center class=\"new\">";
while ($row = mysql_fetch_array($result)) {
$BasketID = $row['BasketID'];
$BasketName = $row['BasketName'];
$BasketPrice = $row['BasketPrice'];
$BasketImageThumbnail = $row['BasketImageThumbnail'];
}
for($count2=0; $count2<=$total; $count2++) {
echo"<img src=\"graphics/$BasketImageThumbnail\" border=0>
<br><a href=\"basket_info.php?BasketID=$BasketID\">$BasketName</a>
<br>\$$BasketPrice
<hr size=1 width=\"90%\" color=\"silver\">";
}
print"</td>";
}
?>