PHP Code:
$q1 = "SELECT `id` FROM `{$dbprefix}GamesPlayed`";
$result = mysql_query($q1);
$row = mysql_fetch_array($result);
$max = count($row);
for($i = 0; $i <= $max; i++)
{
$q2 = "SELECT `id` FROM `{$dbprefix}members` WHERE `maingame` = '".$row[$i]."'";
$result2 = mysql_query($q2);
echo $row[$i];
echo "-->";
echo mysql_num_rows($result2);
}
This wouldn't work..
I tried it in the sql and it came up blank as well..
why would we select Id from members? the maingame is indeed a number
and we need to set the maingame = the id from gamesplayed..
see it gets confusing..
when i put this in my phpmyadmin
SELECT maingame, COUNT('1') FROM {$dbprefix}members GROUP BY maingame
it comes up with 5
wich is correct.. so my function has the right format is just has an error somewhere!