dragonstable Posted June 14, 2006 Share Posted June 14, 2006 <html><head><link rel="stylesheet" type="text/css" href="style.css"/></head><body><?php include ("head.html"); ?> <!-- Table for Main Body --><table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td valign="top" align="left" width="91"><?php include ("menu.html");?></td><td valign="top"><center><h2><?phpprint "$username";?>'s Inventory</center></h2><br><table align="center"><?php $dbh=mysql_connect ("********", "********", "********") or die ('I cannot connect to the database because: ' . mysql_error());mysql_select_db ("dragonst_users");$data = mysql_query("SELECT * FROM items WHERE user='$username'")or die(mysql_error());while($info = mysql_fetch_array( $data )){Print '<td width="20%">';Print "<center> ".$info['itemname'] . " <br>";Print "<img src=http://dragonstable.fileplace.biz/".$info['image'] ."> <br>"; Print " ".$info['rarity'] . "</center></td>";}Echo '</table>'; ?><br> <br> </td><td width="1" valign="top"> </td></tr></table></body></html>Basically thats my code i have at the moment, What i want it to do is show 5 entries from the array in the first row of the table, and then the next 5 entries in the next row and so on, so that way it doesnt scroll across the screen and keep going...Please help, thanks in advance... Quote Link to comment https://forums.phpfreaks.com/topic/11965-php-and-arrays-and-tables-aaarrrgggg/ Share on other sites More sharing options...
trq Posted June 14, 2006 Share Posted June 14, 2006 This question is asked all the time, henace, the answer is perminently posted [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=95426\" target=\"_blank\"]here[/a]. Quote Link to comment https://forums.phpfreaks.com/topic/11965-php-and-arrays-and-tables-aaarrrgggg/#findComment-45463 Share on other sites More sharing options...
dragonstable Posted June 18, 2006 Author Share Posted June 18, 2006 thanks, had no idea it was sitting there... Quote Link to comment https://forums.phpfreaks.com/topic/11965-php-and-arrays-and-tables-aaarrrgggg/#findComment-46964 Share on other sites More sharing options...
dragonstable Posted June 18, 2006 Author Share Posted June 18, 2006 actually turns out i did read that before... it just confused me more though.... Quote Link to comment https://forums.phpfreaks.com/topic/11965-php-and-arrays-and-tables-aaarrrgggg/#findComment-46966 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.