im trying to restrict my query to the first 5 record but its not working it keeps returning all records.
// Performing SQL query
$query = 'SELECT GameID, Date(GameDate) AS GameDate, G_Time, R_Name,
(SELECT Concat(Team.SchoolName,\' \',Team.Mascot) FROM Team WHERE Team.TeamID=A_TeamID) AS AwayTeam,
A_TeamScore,
(SELECT Concat(Team.SchoolName,\' \',Team.Mascot) FROM Team WHERE Team.TeamID=H_TeamID) AS HomeTeam,
H_TeamScore,
Game.ResultType
FROM Game
INNER JOIN Team ON A_TeamID=Team.SchoolName OR H_TeamID=Team.TeamID
INNER JOIN Rink ON Game.Rink_ID = Rink.Rink_ID
WHERE Game.DivisionID='.$did.' AND Game.Completed = 0 AND Game.SeasonID=2 AND Game.GameType=\'Regular\'
GROUP BY GameID
ORDER BY GameDate ASC, G_Time ASC
LIMIT 5';
// Performing SQL query
$query = 'SELECT GameID, Date(GameDate) AS GameDate, G_Time, R_Name,
(SELECT Concat(Team.SchoolName,\' \',Team.Mascot) FROM Team WHERE Team.TeamID=A_TeamID) AS AwayTeam,
A_TeamScore,
(SELECT Concat(Team.SchoolName,\' \',Team.Mascot) FROM Team WHERE Team.TeamID=H_TeamID) AS HomeTeam,
H_TeamScore,
Game.ResultType
FROM Game
INNER JOIN Team ON A_TeamID=Team.SchoolName OR H_TeamID=Team.TeamID
INNER JOIN Rink ON Game.Rink_ID = Rink.Rink_ID
WHERE Game.DivisionID='.$did.' AND Game.Completed = 0 AND Game.SeasonID=2 AND Game.GameType=\'Regular\'
GROUP BY GameID
ORDER BY GameDate ASC, G_Time ASC
LIMIT 5';