Finally working but...
Posted: Thu Sep 17, 2009 9:57 am
Ok well the 'inventory' script I was designing to allow only 4 of each item per row now works however after the first picture the rest all come out as broken links...even though the number of broken links adds up to the number of pictures that should be displaying.
I want to know where I've gone wrong please:
I want to know where I've gone wrong please:
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>";
//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");
echo "<table border=0>";
$rows = mysql_fetch_array($query);
$items = mysql_query("SELECT * FROM items WHERE id='$rows[itemid]'");
for($x=0;$x<mysql_num_rows($query);$x++)
{
$items1 = mysql_fetch_array($items);
if($x%4==0)
{
echo "<tr></tr>";
}
echo "<td><img src='http://kurukolands.co.uk/images/items/$items1[image]'><br /><font color='green'>$items1[name]</font></td>";
}
echo "</table>";
echo "$close";
?>