Thread: Function Help
View Single Post
  #15 (permalink)  
Old 04-24-2008, 12:05 AM
Whitey's Avatar   
Whitey Whitey is offline
Programming Professional
 
Join Date: Feb 2008
Location: Loveland, Colorado
Posts: 225
Credits: 0
Rep Power: 7
Whitey has a spectacular aura aboutWhitey has a spectacular aura aboutWhitey has a spectacular aura about
Send a message via AIM to Whitey Send a message via MSN to Whitey Send a message via Skype™ to Whitey
Default Re: Function Help

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>'
;

Reply With Quote

Sponsored Links