I have a page that lists player statistics for various type of leagues. A visitor can select a certain league to view, but when no league is selected, I would like the statistics at random show 5-10 different leagues.
The MYSQL query looks like this as of now:
SELECT player.PlayerID, player.Firstname, player.Lastname, player.Pos, player.NationID, team.TeamID, team.Team, stats.PlayerID, stats.KID, stats.TeamID, stats.GP, stats.G, stats.A, stats.TP, stats.PIM, LPAD(stats.TP,5,'0') as TP, LPAD(stats.G,5,'0') as G, LPAD(stats.GP,5,'0') as GP FROM player
INNER JOIN stats ON player.PlayerID=stats.PlayerID
INNER JOIN team ON stats.TeamID=team.TeamID
WHERE stats.League='$statsleague' AND stats.StartDate='2009' AND player.POS <> 'G' ORDER BY TP DESC, G DESC, GP ASC LIMIT 5
WHERE stats.League = '$statsleague' is the variable that I want to at random have 5-10 different league names at each page reload.
How would you figure I can solve this the best way?
Lets say that these 5 are the league names I would like to appear at random
- NHL
- AHL
- ECHL
- NCAA
- SM-Liiga
Thanks for any input!