I am using the MySQL GROUP BY function, and want to know if there is a way to get the number of items for that group without having to a query again?
$homePointsPlayerResult = mysql_query("SELECT `player_id` FROM `conversions` WHERE `game_id` = '$game_id' AND `team_id` IS NULL GROUP BY `player_id`");
while ($players_with_points_conversions[] = mysql_fetch_row($homePointsPlayerResult)) {
if (array_search($players_with_points_conversions['player_id'],$home_players,true) == FALSE) {
$home_players['player_id'] = $players_with_points_conversions['player_id'];
$home_players['conversions'] = {WANT NUMBER OF ELEMENTS FOR THIS GROUP};
}
}
I would really appreciate your answers. Thanks in advance.