Hi,
just a comment for future reference; A topic of help help help is not helping people to understand what your problem is. If you statr a thread, it is assumed you need help. Better start a thread with a topic like 'Query output to 3 * 3 or something.
in any case.. I have a play with your script. You should really remove all the font, width and stuff from it, and justuse your classes to define those elements.
I think this is roughly what you where trying to do; this is probably going to give you some errors, as I cannot test it here, and I just typed it up quickly..:
<?php include 'functions.php';
connect();
// setting it to intval already takes care of any malicious code
$id = intval($_GET['id']);
// Perform a query on all tables in one go, by linking them on the matching fields.
// If fieldnames are unique you do not need to include the tablename
$query = "SELECT ava_games.name, avagames.id, ava_games.description, ava_games.image, ava_games.display
FROM ava_users
left join favorites on ava_users.id = favorites.uid
left join ava_games on favorites.gameid = avagames.id
where ava_users.id = ".$id."
limit 9";
?>
<table border="0" cellpadding="0" cellspacing="0" width="742px" class="side">
<tr>
<td class="btitle" valign="top" colspan="2"><?php echo $name; ?>'s Favorites</td>
</tr>
<tr>
<td align="left">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<?php
// ru the query,and - for development purposes - die on error, and produce the error
$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
$i = 0;
while($row = mysql_fetch_array($result))
{
echo "
<td width=\"35\" height=\"35\" bgcolor=\"ffffff\" class=\"text\">
<img src=\"".$row['image']."\" alt=\"\" width=\"90\" height=\"90\" />
<font color=\"#333333\">
<b>
<a href=\"game.php?id=".$row['id']."\" class=\"dlink\">".$row['name']."</a>
</b>
</font>
</td>
":
if($i%3 == 0 && $i <> 9)
{
echo "</tr><tr>";
}
}
for($j=$i; $j<=9; $j++)
{
echo "<td></td>";
}
}
else
{
echo "No records found";
}
?>
</tr>
</table>
'