I have an ID for each game, and i now have been able to show the latest games, in this case by using a query on the ID coloumn selecting only the last 3 and displaying them DESC. Here is my code.
CODE
<?php
// top_games.php
// Make sure it works
define('IN_SITE', true);
// Grab the connect.php file so we can connect
require_once('connect.php');
// Get the results, and order them by 'count' from highest to lowest
// If you wanted the top 100 only, add this after DESC and before ":
// LIMIT 1,100
$result = mysql_query("SELECT * FROM `Action` ORDER BY `id` DESC LIMIT 0,3") or die(mysql_error());
// Output table:
?>
</div>
<table width="146" height="52" border="0" align="left" cellpadding="2" cellspacing="0" style="border: 0px solid #000000">
<?php
// Run a loop through the results
while ($row = mysql_fetch_array($result)) {
?>
<tr>
<td width="44"><img src="<?php echo $row['image']; ?>" width="25" height="25" border="0" /></td>
<td width="138"><div align="center"><a href="g_<?php echo strtolower(preg_replace("/\s/", "_", $row['game_name'])); ?>.php"><?php echo $row['game_name']; ?></a></div></td>
</tr>
<?php
// End the table
}
?>
</table>
My problem is that, the query shows the last 2 games on the list, but also shows ID 1. So for example, i have just added 3 new games, game 9 10 and 11. The query should show 9 10 and 11, however it seems to show 1, 10 and 11. That is my problem is there anybody out there who can help?
Thanks in advance.
PS - sorry my first post was in the wrong category just realised, so reposted it here.