Sorting my data

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
glenn
Forum Newbie
Posts: 18
Joined: Fri Apr 19, 2002 7:42 am
Location: London, England (UK)

Sorting my data

Post by glenn »

Hi

I need help some help getting PHP script to display data from a table in my MySQL DB, I want to use just one column, with a 4 digit number, and to be printed out in a numerical format by that column. e.g.

This is what would be in the DB:

6666
6665
6667
6664

I would want if printing like :

6667
6666
6665
6664

Please help me! :)
Craig
Forum Commoner
Posts: 37
Joined: Thu Apr 18, 2002 3:13 pm

Post by Craig »

Code: Select all

ORDER BY $yourcolumn DESC
should be what you are after.

this goes at the end of your MySql query
prasadharischandra
Forum Commoner
Posts: 57
Joined: Thu May 09, 2002 2:19 am
Location: sri lanka
Contact:

Post by prasadharischandra »

use DESC like this
where tablename order by tablefield DESC;
Post Reply