Jump to content

PHP and Arrays and Tables AAARRRGGGG


dragonstable

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...
Link to comment
https://forums.phpfreaks.com/topic/11965-php-and-arrays-and-tables-aaarrrgggg/
Share on other sites

Archived

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

×
×
  • Create New...

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.