my inventory script looks like this right now;
Code:
<?php
include("inc/functions.php");
include("inc/config.php");
//***************//
// START SCRIPT //
//***************//
$themeurl = grabanysetting("themeurl");
$links = getlinks();
$ads = getads("any");
$pagecontent = getsitecontent("index");
$article_title = $pagecontent[title];
$article_content = $pagecontent[content];
$article_content = nl2br($article_content);
$article_title = "Your Inventory";
if ($isloggedin == "yes") {
$article_content = "Here you can see a list of items that you have collected.<table width='500' border='2'>
<tr>
<td width='200'><strong>Picture:</strong></td>
<td width='230'><strong>Item Type: </strong></td>
<td width='70'><strong>ID Number:</strong></td>
</tr>";
$query = "SELECT * FROM ".$prefix."useritems WHERE Owner = '$loggedinname'";
$result = mysql_query($query);
$num = mysql_numrows($result);
$i=0;
while ($i < $num) {
$iid=@mysql_result($result,$i,"ID");
$object=@mysql_result($result,$i,"Item");
$url=@mysql_result($result,$i,"imageurl");
$article_content = $article_content."<tr>
<td><center><img src='".$url."'></center></td>
<td><center>".$object."</center></td>
<td><center>".$iid."</center></td>
</tr>";
unset($iid);
unset($object);
$i = $i + 1;
}
$article_content = $article_content."</table>";
}
else {
$article_content = "You must be logged in to view items.";
}
//***************//
// OUTPUT PAGE //
//***************//
echo showpage($article_title, $article_content, $date);
?>
the page is now showing up, but the layout is out of whack - it has large text, and it says "Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home/gloometh/public_html/inventory.php on line 30" near the top of the page.
the page looks fine when i'm logged out though.