You'd have to test this and see if it's inefficient. I don't know how many
sites you have.  But, how about two output loops:

<CFQUERY - get all the countries, cities, etc> and then
start your drop down box:
<select>

   <cfoutput>
       <cfif myquery.country eq "USA" >
               <OPTION value=#CityID#> #Country#, #City#
        </cfif>
   </cfoutput>
  this would put out all the usa ones first. Then don't close the dropdown
list yet. Add others in same format:

   <cfoutput><cfif myquery.country neq "USA"> <OPTION value=#CityID#>
#Country#, #City#</cfif></cfoutput>

</select>


This may already be your "workaround" but thought I'd suggest it anyway.

Mark

[EMAIL PROTECTED]



Hi.  I have a dropdown list that lets users pick a country from a list of
company locations stored in a database.  Possible entries are France
(Paris), England (London), etc. It all works fine.  However, my supervisor
wants the USA (Cityname) entries to appear at the top of the list, since
they are the most common.  I created this list using two separate SQL
queries, which I then used to generate the dropdown list.  Is there a way
to
do this sort using just a single SQL statement, so that I do not have to
juggle two queries?

For example, the list should look like this in the dropdown:

USA (Albequerque)
USA (Boston)
USA (Chicago)
Argentina (Buenos Aires)
Bolivia (La Paz)
Canada (Toronto)
etc.


Any ideas?

Thanks,
Matthieu
~~~~~~~~~~~~~ Paid Sponsorship ~~~~~~~~~~~~~
Get Your Own Dedicated Win2K Server!      Instant Activation for $99/month w/Free 
Setup from SoloServer      PIII600 / 128 MB RAM / 20 GB HD / 24/7/365 Tech Support     
 Visit SoloServer, https://secure.irides.com/clientsetup.cfm.

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to