$query = "SELECT theitemid, uitemid, location, image FROM uitems LEFT JOIN items ON userid='$uid' AND location='1'";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)) {
$itemid = $row['theitemid'];
$uitemid = $row['uitemid'];
$loc = $row['location'];
echo "<a href=?act=view&uitemid=$uitemid><img src=items/$iimage></a><br>$iname";
}
Looks like in your first query, you are doing this. I moved the echo to the top query and changed the query aswell... Im not incredibly strong w/ JOIN statements, and I dont have a MySQL box around to toy with, so you may get a syntax error, but essentially you will want to try out multiple JOIN statements to display the items image w/o having to query the database twice.