Jump to content

Archived

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

dragonstable

PHP and Arrays and Tables AAARRRGGGG

Recommended Posts

<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>
<?php
print "$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...

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.