I have a MYSQL5 and PHP 5 database. I need a query for the index page of game websites in which only the first 12 of each category of games are selected. Here is what I still have.
$db->query("SELECT * FROM `games` WHERE status = 'game_published' AND `featured` = '1' ORDER BY `category`");
Then the php code combines the games of the same category and displays them. But yes, this does not limit the number of games from each category as I want.
Here's what the table structure looks like: i49.tinypic.com/aysoll.png
Here is a blog post that sounds like what I'm trying to do: http://www.e-nformation.net/content/view/title/MySQL+Top+N+in+each+group+(group+inner+limit ) But I can not understand this.
Any help is appreciated.
Neddy source
share