Solved

How do i output my sql database field names in a <cfquery> tag?

Posted on 2009-04-04
2
159 Views
Last Modified: 2013-12-24
I would like to output the field names of my sql database table. I know how to output the actual data in a table using <cfquery> and <cfoutput query=> but i want to know to display the field names themselves in a repeating table.
0
Comment
Question by:rarid122481
2 Comments
 
LVL 16

Accepted Solution

by:
duncancumming earned 500 total points
ID: 24068487
<cfquery name="getData" ...>
SELECT *
FROM yourTable
</cfquery>

<cfoutput>
<cfloop index="column" list="#getData.ColumnList#">
#column#<br>
</cfloop>
</cfoutput>
0
 
LVL 27

Expert Comment

by:azadisaryev
ID: 24068509
keep in mind, though, that #queryname.columnlist# always returns the query columns in alphabetical order, NOT in the order you use them in your SELECT clause...

Azadi
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question