Good day. You can do this using the "ORDER" clause in SQL. Please consult your particular database's documentation for more information.
Alternately, you can load all of the unsorted results into an associative array, and use PHP's native sorting functions (such as ksort() ) to sort the results. ============================ Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -----Original Message----- From: Chuck Barnett [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 03, 2002 1:50 PM To: PHP General List Subject: [PHP] sorting data from a field Hello again :) I have a db field that holds the first and last name of a person. Is there a way to sort by the last name in that field? The whole reason for this is to populate a select box sorted by last name. I don't want to go back and create a separate field if I don't have to. Any help is appreciated. Thanks, Chuck -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php