Log in

View Full Version : Sorting file numbers



wibumba
11-20-2008, 01:04 AM
The files in my database are numbered. What I'm trying to do is get the file name that has the highest number, then second highest, third, etc

Any help would be awesome.

Nile
11-20-2008, 01:46 AM
This should help:


$query = "SELECT * FROM `foo` ORDER BY `column_count` DESC";

The column_count should be replaced with your field that is numbered, and the foo should be replaced with your table name. I hope that this helps!

wibumba
11-20-2008, 02:07 AM
Well, it's not sql. It's files in a directory...

Nile
11-21-2008, 04:23 AM
Oh, sorry I thought you meant SQL because you said database, you should be more clear on what kind of database. Sorry! I don't have anything for you, I'm not good with the dir() functions!