Select

I was wondering if somebody could help me… I’m selecting some data from a table and need to get it to display the list in order of an id, i need the data with the highest request id to be displayed first…

Here is my current select statement

[php]
$query = “SELECT * FROM request_data WHERE state=‘old’”;
$result = mysql_query($query,$dbid)
or die(“INSERT error:”.mysql_error());
[/php]

Do i use a SORT or ORDER? Could somebody give me an example.

Thanks

http://dev.mysql.com/doc/refman/4.1/en/ … -rows.html
http://dev.mysql.com/doc/refman/4.1/en/select.html
http://dev.mysql.com/doc/refman/4.1/en/ … ation.html

Thanks for those links, i didn’t make myself very clear but i already had a good idea how to do it with ORDER but i was putting the ORDER before the WHERE and it was chucking out syntax errors. It was a long day yesterday so my question didn’t make that clear at all! :D

Thanks for the links by the way, excellent read!

Sponsor our Newsletter | Privacy Policy | Terms of Service