Solved

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

Posted on 2009-04-04
2
158 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
Comment Utility
<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
Comment Utility
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now