Hi
I dont want the query to be sorted alphabetically I want it to be sorted by my list.
I hope this explains better what I want to do:
I have a category list "e,c,b,d,a" and I have marked the items in the database with "cat1" which are the items that are in the list.
<cfquery datasource="database" name="test">
SELECT itemname, itemcategory FROM table WHERE itemcategory = 'cat1'
</cfquery>
I have five items in the database where itemcategory="cat1", the itemnames are: a,b,c,d,e
After I have gotten my query I would like to display the query according to my list
If I could output the query according to my list then I would get a output like this:
e
c
b
d
a
Main Topics
Browse All Topics





by: pinaldavePosted on 2005-08-09 at 06:10:07ID: 14632159
<cfquery datasoure="database" name="test">
SELECT data FROM table
</cfquery>
<cfset myList = ValueList(test.data)>
<p>Here is the unsorted list. </p>
<cfoutput>#myList#
</cfoutput>
<p>Here is the list sorted alphabetically:</p>
<cfset sortedList = ListSort(myList, "Text")>
<cfoutput>#sortedList#
</cfoutput>