[snip] SELECT * FROM Course ORDER BY locationID ASC Now the ORDER BY can be any one of five things based on the variable passed by the hyperlink for the column they clicked on (location, course, date, category, and instructor [/snip] If you had a JOIN to the location table you could order by the actual location. Here is an example... SELECT c.courseName, l.locationName FROM Course c, Location l WHERE c.locationID = l.locationID ORDER BY l.locationName [snip] Sorry that this has degenerated into a MySQL question rather than PHP. I was originally looking for how people handled it in PHP. [/snip] Actually it didn't degenerate, it was a SQL question all along. Unless you had a desire to build sortable arrays in PHP this type of sort should always be done on the SQL side because it would be much more efficient. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php