Uncaught Exception: SqlException

Message:
invalid query:- SELECT recently_played.game_id,flashgame.id,flashgame.game_name,flashgame.game_url From flashgame,recently_played
where recently_played.game_id=flashgame.id group by game_id,id,game_url order by recently_played.id DESC LIMIT 0,5

Lost connection to MySQL server during query
Created in file /home/freegame/public_html/GL/lib/database/SqlDatabaseManager.class.php on line 148.

Stack Trace:
#0 /home/freegame/public_html/appcode/datamanager/FlashGameManagementDataManager.class.php(733): SqlDatabaseManager->executeQuery('SELECT recently...')
#1 /home/freegame/public_html/protected/controller/viewgame.php(570): FlashGameManagementDataManager->getRecentlyPlayedGame()
#2 /home/freegame/public_html/protected/controller/viewgame.php(48): viewgame->recentlyPlayed()
#3 /home/freegame/public_html/GL/lib/Application.class.php(66): viewgame->initialize()
#4 /home/freegame/public_html/index.php(32): Application::run(Object(HttpRequest))
#5 {main}
4.
In file /home/freegame/public_html/appcode/datamanager/FlashGameManagementDataManager.class.php line 733.
Method: SqlDatabaseManager->executeQuery([$query FILTERED])
3.
In file /home/freegame/public_html/protected/controller/viewgame.php line 570.
Method: FlashGameManagementDataManager->getRecentlyPlayedGame()
2.
In file /home/freegame/public_html/protected/controller/viewgame.php line 48.
Method: viewgame->recentlyPlayed()
1.
In file /home/freegame/public_html/GL/lib/Application.class.php line 66.
Method: viewgame->initialize()
0.
In file /home/freegame/public_html/index.php line 32.
Method: Application::run([$request FILTERED])