Layout of pictures issue.
Posted: Wed Sep 16, 2009 2:15 pm
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Ok we'll earlyer I had issues with the layout of these pictures for a script im writing. Since then however it has worked out to an extent but now even if I only have two pictures in the database it shows a lot of them I don't really know how to explain very well. But just tell me if theres more you need to know.
Heres the code:
Thanks.
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Ok we'll earlyer I had issues with the layout of these pictures for a script im writing. Since then however it has worked out to an extent but now even if I only have two pictures in the database it shows a lot of them I don't really know how to explain very well. But just tell me if theres more you need to know.
Heres the code:
Code: Select all
<?php
require("../includes/config.php");
echo "$open";
if(isset($loggedout))
{
die("$loggedout");
}
//Makes the username's first letter uppercase.
$ucusername = ucfirst($username);
echo "<h1>$ucusername's House Storage</h1>";
//This does...
//Checks in the 'inventory' whether there are any items belonging to the user with the ID set to their account.
$query = mysql_query("SELECT * FROM storage WHERE userid='$id' LIMIT 10");
while($rows = mysql_fetch_array($query))
{
echo "<table>";
$itemsquery = mysql_query("SELECT * FROM items WHERE id=$rows[itemid]");
$rows2 = mysql_fetch_array($itemsquery);
for($x = 0; $x < 3; $x++)
{
echo "<tr>";
for($c = 0; $c < 4; $c++)
{
echo "<td><img src='http://kurukolands.co.uk/images/items/$rows2[image]'><br /><font color='green'>$rows2[name]</font></td>";
}
echo "</tr>";
}
echo "</table>";
}
echo "$close";
?>pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: