Solved

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

Posted on 2009-04-04
2
160 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

735 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