Hi,
I just set up a database with tutorials (id, title, description, image, url, cat)
id is auto_increment, so the highest id should always be the last tutorial.
I want to show the last 5 tutorials on a page, so I tried to use this:
<?php
include("connect.php");
$sql=mysql_query("SELECT * FROM tutorials ORDER BY id DESC LIMIT 0,5") or die(mysql_error());
$x=0;
while($row=mysql_fetch_row($sql))
{
echo ($x+1).') '.$row[title].'<br />';
$x++;
}
?>
But I got this output:
1)
2)
3)
4)
5)
A little help please? :bemused: