Andrius,
Seriously, work through a SQL tutorial and you'll have all your questions
answered.
Here's a good link: http://developer.ecorp.net/sqltut.htm
just remember that MySQL doesn't support sub queries.
The ORDER clause in a SQL SELECT statement determines the order of the
returned records.
$query = "SELECT * FROM table WHERE field = 'criteria' ORDER BY field";
$result = mysql_query("db","$query");
this sort order is ascending. to get descending order, use:
ORDER BY field DESC
you should, however, go to the previously recommended site for a tutorial.
your questions will be answere