SfC Home > ColdFusion >
Reader questions and feedback on ColdFusion Development. Also refer to markup language, CFML, Macromedia, Dreamweaver, code, web site, Ron Kurtus, School for Champions. Copyright © Restrictions
Answers to Readers' Questions on ColdFusion Development:
Sorting Table
The following 1 comments and questions have been sent in. They are listed according to date.
List of first 10 items
Sorting
Question
November 27, 2003
Hi, i have one question. How do i sort multi-column data on my website. For instance i have linked a DB to my webstie, N DB has 4 columns which i want to sort in different order, e.g. two in ascending order and other two in descending order, so how do i go about doing that? pls get back to me, i really need help on that.
Thanx.
Dave.
Dave -
1392
Answer
Suppose you enter ACTION.CFM by submitting a form from FORM.CFM. You set up your query in the action page as follows:
SELECT *
FROM invoices
WHERE company = '#url.company_sort#'
ORDER BY '#url.sortby#'
SELECT *
FROM invoices
WHERE company = '#form.company#'
ORDER BY company
Then in the title row of your table:Name Name
etc.
The content of your table is as you have it.
Clicking on a title will re-do the query, ordering by the item listed.
I hope that works out for you.
Summary
Hopefully, this reader feedback has helped provide information about ColdFusion issues.
Always do your best
Resources
The following are some resources on this topic.
Websites
Books
What do you think?
Do you have any questions, comments, or opinions on this subject? If so, send an email with your feedback. We will try to get back to you as soon as possible.
Feel free to establish a link from your website to pages in this site.
Where can you go from here?
Answers to Readers' Questions
