Cold Fusion Development
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Remember me

Go Back   Dev Articles Community ForumsProgrammingCold Fusion Development

Add This Thread To:   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
Unread Dev Articles Community Forums Sponsor:
Old March 15th, 2005, 01:17 PM
lazerbrains lazerbrains is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
Join Date: Mar 2005
Location: Missoula, MT
Posts: 3 lazerbrains User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 m 39 sec
Reputation Power: 0
Organizing query output.

I am doing a query on a MySQL Database and pulling all shops out of our data. That works fine except I want to organize all the shops by state. For instance, Alaska, and then list all the shops in Alaska. Here is the functioning code that brings me a list of all States and Countries, and then a list of all the shops. Does anyone have an idea to get this output organized the way I want it? I just want It to list a state and then all the shops in that state and then the next state and all the shops in that state.

Here's the Code:


<cfquery datasource="#DataSource2#" name="getdata">
SELECT lTitle, lDescription, lState, lCountry, lPhone, lEmail, lWebsite, lCategory, strClubShop
FROM zListings_CYP
WHERE lType = 2 AND (strCustomerID <> '' AND strCustomerID IS NOT NULL) AND lStatus = 'Print Ready'
ORDER BY lState, lTitle

<font face="verdana,arial" size=2 color="#0066CC"><b>CYP Clubs and Shops LISTINGS</b>

<font face="verdana,arial" size=2 color="#000000">
<!---<cfoutput query=getdata group=lCategory><font color="##CC0000"><b>#lCategory#</b></font><br><br>--->
<cfoutput query=getdata group=lState><font color="##CC0000"><b><cfif lState IS "">#lCountry#<cfelse>#lState#</cfif><b><br></cfoutput><br>
<cfoutput query=getdata group=strClubShop><font color="##000000">
<cfoutput><cfif strClubShop IS "S">XSHOP<cfelse>XCLUB</cfif> <b>#Replace(lTitle, "`", "'")#</b> #lPhone#, #lEmail#, #lWebsite# <br><br></cfoutput><br>



Reply With Quote

Viewing: Dev Articles Community ForumsProgrammingCold Fusion Development > Organizing query output.

Developer Shed Advertisers and Affiliates

Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap