...

View Full Version : comparing tables help



ptmuldoon
12-22-2007, 05:55 PM
I'm trying to compare a user's name to a list of tables, and get total of how many tables the user is found in. I think I'm close, but it keeps returning 0 for each user, when it should return the number of matches.

I'm still learning to understand arrays better, thus I think I missed something there. But does anyone see something I missed?


$users = 0;
while ($users < mysql_num_rows($query1)) {
$game = 0;
$sql2 = "SELECT id FROM ".$this->settings->mysql_prefix."games WHERE id > 0";
$games = mysql_query($sql2);

$id = 0;
$active_games = 0;
while ($id < mysql_num_rows($games)) {
$sql3 = "SELECT * FROM " .$this->settings->mysql_prefix."game_".$game[$id]." WHERE player = ".$player['login']." ";
$plyr = mysql_query($sql3);
$plyrs = array($plyr);

if ($plrs['player'] == $player['login'] ) {
$active_games++;
}
$id++;
}
$users++;
}

GO ILLINI
12-22-2007, 08:24 PM
I'm pretty sure you cant just make a query response into an array... try the mysql_fetch_array function instead.
http://us3.php.net/mysql_fetch_array


-Adam



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum