Ok, im coding an announce sistem for a site... I made EVERYTHING work, but the order of how the announcements are shown...
this is the code:
As you can see its limited to 5, and the order should be shown like this:PHP Code:<?
$query = "Select id,message from announcement order by id DESC limit 5";
$command = mysql_query($query)
or die($db_error);
print "<table width=\"270\" cellpadding=\"1px\" align=\"center\" border=\"1\" style=\"border-style:solid; border-width:thin; border-collapse:collapse;\" cellspacing=\"0px\">";
while($result = mysql_fetch_array($command))
{
print "<tr><td>".$result['message']."</td></tr>";
}
print "</table>";
print "<br /><br />";
?>
but, actually its being ordered likeCode:5
4
3
2
1
And when i add the value 6 it must at least be like thisCode:1
2
3
4
5
But somehow the order staysCode:2
3
4
5
6
I know someone made the same post... but i also checked the MySQL error he had...Code:1
2
3
4
5
i placed id as INT, i tried to place as PRIMARY KEY and auto_increment, but each time i insert a new announcement it says duplicated primary key, even if the first announcement has id 100 and the second has id 876...Code:`id` INT( 10 ) NOT NULL ,
`message` VARCHAR( 225 ) CHARACTER SET armscii8 COLLATE armscii8_bin NOT NULL
PLEASE! T_T HELP ME!

