Thread: Function Help
View Single Post
  #12 (permalink)  
Old 04-23-2008, 03:02 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,569
Last Blog:
Tidy up your HTML
Credits: 0
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default Re: Function Help

Exactley. Hence the for loop:
PHP Code:
for($i 0$i <= $maxi++)
{
    
$q2 "SELECT `id` FROM `Members` WHERE `maingame` = '".$row[$i]."'";
    
$result2 mysql_query($q2);
    echo 
$row[$i] . "-->" mysql_num_rows($result);

$row[$i] is the game id (in the previous post I statically set $row[$i] = 1). However, $row is an array of game id's which are dynamically generated upon request. The for loop circulates through the entire array of game id's and calculates the amount of members have have the game id, $row[$i], as their main game.
Reply With Quote