PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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.
<?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";
?>
Yes they exist since the endings are coming directly from a database. The first of which appears fine and as it should the other 4 however do not appear and are left with 4 broken icons and when I look at the properties it doesn't display the ending of /items/ ...so Im a bit stuck.