Thread: Function Help
View Single Post
  #13 (permalink)  
Old 04-23-2008, 09:00 PM
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

PHP Code:
$q1 "SELECT `id` FROM `{$dbprefix}GamesPlayed`";
$result mysql_query($q1);
$row mysql_fetch_array($result);
$max count($row);

for(
$i 0$i <= $maxi++)
{
    
$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!

Last edited by Whitey; 04-23-2008 at 09:05 PM.
Reply With Quote