Jump to content


This topic is now archived and is closed to further replies.


PHP and Arrays and Tables AAARRRGGGG

Recommended Posts

<link rel="stylesheet" type="text/css" href="style.css"/>
include ("head.html");
<!-- Table for Main Body -->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<td valign="top" align="left" width="91">
include ("menu.html");
<td valign="top">

print "$username";
?>'s Inventory

<table align="center">
$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 width="1" valign="top"> </td>


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...

Share this post

Link to post
Share on other sites
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].

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.