my function updated..
it shows the games.. but the count is messed up.
it comes out for every game 1 as the count.
here is the code
PHP Code:
function getGameStats()
{
global $dbprefix;
$query = "SELECT * FROM {$dbprefix}gamesplayed";
$result = mysql_query($query)
or die(mysql_error());
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>';
for ($i = 0; $i < mysql_num_rows($result); $i = $i + 1)
{
$gamepic = mysql_result($result, $i, "gamepic");
$gamename = mysql_result($result, $i, "gamename");
$id = mysql_result($result, $i, "ID");
$query1 = "SELECT 'id' FROM {$dbprefix}members WHERE maingame = $id";
$result1 = mysql_query($query1) or die(mysql_error());
$stat = mysql_num_rows($result1);
$stat = count($stat);
echo ("<td><div align='center'><img src='$gamepic' alt='$gamename'> $stat</div></td>");
}
echo ' </tr>
</table>';
}