currently I have an inventory system which allows me to have it showing, but if something changes it needs to be refreshed to show the changes, how do I make it update?
$result2 = mysql_query("SELECT * FROM inventory WHERE username = '$login'");
$output2 = mysql_fetch_array($result2);
$poutput = $output2['space1'];
$result3 = mysql_query("SELECT * FROM items WHERE itemID = '$poutput'");
$output3 = mysql_fetch_array($result3);
echo "<div style = 'clear: right; border: 1px white solid; width: 80px; height: 80px; float: right;'><img src = '" . $output3['directory'] . "' /></div>";
$poutput = $output2['space2'];
$result3 = mysql_query("SELECT * FROM items WHERE itemID = '$poutput'");
$output3 = mysql_fetch_array($result3);
echo "<div style = 'border: 1px white solid; width: 80px; height: 80px; float: right;'><img src = '" . $output3['directory'] . "' /></div>";
$poutput = $output2['space3'];
$result3 = mysql_query("SELECT * FROM items WHERE itemID = '$poutput'");
$output3 = mysql_fetch_array($result3);
echo "<div style = 'border: 1px white solid; width: 80px; height: 80px; float: right;'><img src = '" . $output3['directory'] . "' /></div>";
$poutput = $output2['space4'];
$result3 = mysql_query("SELECT * FROM items WHERE itemID = '$poutput'");
$output3 = mysql_fetch_array($result3);
echo "<div style = 'clear: right; border: 1px white solid; width: 80px; height: 80px; float: right;'><img src = '" . $output3['directory'] . "' /></div>";
$poutput = $output2['space5'];
$result3 = mysql_query("SELECT * FROM items WHERE itemID = '$poutput'");
$output3 = mysql_fetch_array($result3);
echo "<div style = 'border: 1px white solid; width: 80px; height: 80px; float: right;'><img src = '" . $output3['directory'] . "' /></div>";
$poutput = $output2['space6'];
$result3 = mysql_query("SELECT * FROM items WHERE itemID = '$poutput'");
$output3 = mysql_fetch_array($result3);
echo "<div style = 'border: 1px white solid; width: 80px; height: 80px; float: right;'><img src = '" . $output3['directory'] . "' /></div>";
$poutput = $output2['space7'];
$result3 = mysql_query("SELECT * FROM items WHERE itemID = '$poutput'");
$output3 = mysql_fetch_array($result3);
echo "<div style = 'clear: right; border: 1px white solid; width: 80px; height: 80px; float: right;'><img src = '" . $output3['directory'] . "' /></div>";
$poutput = $output2['space8'];
$result3 = mysql_query("SELECT * FROM items WHERE itemID = '$poutput'");
$output3 = mysql_fetch_array($result3);
echo "<div style = 'border: 1px white solid; width: 80px; height: 80px; float: right;'><img src = '" . $output3['directory'] . "' /></div>";
$poutput = $output2['space9'];
$result3 = mysql_query("SELECT * FROM items WHERE itemID = '$poutput'");
$output3 = mysql_fetch_array($result3);
echo "<div style = 'border: 1px white solid; width: 80px; height: 80px; float: right;'><img src = '" . $output3['directory'] . "' /></div>";
$poutput = $output2['space10'];
$result3 = mysql_query("SELECT * FROM items WHERE itemID = '$poutput'");
$output3 = mysql_fetch_array($result3);
echo "<div style = 'clear: right; border: 1px white solid; width: 80px; height: 80px; float: right;'><img src = '" . $output3['directory'] . "' /></div>";
$poutput = $output2['space11'];
$result3 = mysql_query("SELECT * FROM items WHERE itemID = '$poutput'");
$output3 = mysql_fetch_array($result3);
echo "<div style = 'border: 1px white solid; width: 80px; height: 80px; float: right;'><img src = '" . $output3['directory'] . "' /></div>";
$poutput = $output2['space12'];
$result3 = mysql_query("SELECT * FROM items WHERE itemID = '$poutput'");
$output3 = mysql_fetch_array($result3);
echo "<div style = 'border: 1px white solid; width: 80px; height: 80px; float: right;'><img src = '" . $output3['directory'] . "' /></div>";
$poutput = $output2['space13'];
$result3 = mysql_query("SELECT * FROM items WHERE itemID = '$poutput'");
$output3 = mysql_fetch_array($result3);
echo "<div style = 'clear: right; border: 1px white solid; width: 80px; height: 80px; float: right;'><img src = '" . $output3['directory'] . "' /></div>";
$poutput = $output2['space14'];
$result3 = mysql_query("SELECT * FROM items WHERE itemID = '$poutput'");
$output3 = mysql_fetch_array($result3);
echo "<div style = 'border: 1px white solid; width: 80px; height: 80px; float: right;'><img src = '" . $output3['directory'] . "' /></div>";
$poutput = $output2['space15'];
$result3 = mysql_query("SELECT * FROM items WHERE itemID = '$poutput'");
$output3 = mysql_fetch_array($result3);
echo "<div style = 'border: 1px white solid; width: 80px; height: 80px; float: right;'><img src = '" . $output3['directory'] . "' /></div>";
?>
sorry for the length but I couldn't get a loop to work on all this.