Thanks for your replies, however what I was looking for was to have the
countries sorted by alphabetical order starting with the US. I rewrote
the query to:

"SELECT IF(countries_id='US', 0, 1) as ctsort, countries_id,
countries_name
  FROM TABLE_COUNTRIES 
  ORDER BY ctsort, countries_name"

-----Original Message-----
From: Boaz Yahav [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 25, 2003 12:13 AM
To: Ralph; PHP General Mailing List
Subject: RE: [PHP] Sorting Country List

Why don't you just add a hard coded line like this:

<OPTION VALUE="USA">USA</OPTION>

as the 1st option in your select box?

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-----Original Message-----
From: Ralph [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 25, 2003 6:43 AM
To: PHP General Mailing List
Subject: [PHP] Sorting Country List


I am getting a list of all countries from mysql database, and then I am
sorting by country name. However since most orders will be from US I
want the US to appear first over the rest of the countries. How can I go
about doing this?

Currently, this is my query:

SELECT countries_id, countries_name FROM TABLE_COUNTRIES ORDER BY
countries_name;



-- 
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




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to