PHP Code:
<? $query = mysql_query("SELECT * FROM inventory WHERE username='".$_SESSION['u_name']."' AND user_id='".$id."'"); $number = mysql_num_rows($query); ?> <? if ($number > 0){ ?> <? while ($inv=mysql_fetch_array($query)) { ?> <td style="border:#CCCCCC solid 1px;"><div align="center"><img src="<?=$inv['imgpath']?>" width="100px" height="100px" /><br /><?=$inv['item']?></div></td> <? } ?> <? } ?>
That's what I have so far, and it does work. The only problem is I don't know how to change it in such a way that I can get rows made after X number of items
so this is what it gives to far (each "X" is an item)
XXXXXXXXXXXXXXXXXXXX
and it goes on forever in one row until all items are listed
what I would like to have happen
XXXXX
XXXXX
XXXXX
XXXXX
creates a new row after, in this case, 5 items are listed in a row
Thank For Helping 
|