Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get field names 1

Status
Not open for further replies.

TruthInSatire

Programmer
Aug 12, 2002
2,964
0
0
US
I thought I saw this somewhere but I can't seem to find it.

How can i grab the field names from a table?

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
- Quote by Douglas Adams
 
Code:
#[i]queryname.ColumnList[/i]#
will give you a comma-separated list of column names.


-Carl
 
I knew it was something simple. thanks.

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
- Quote by Douglas Adams
 
I don't think so... not without querying the main system table in your database. The method of doing that is quite dependent on which database you're using (if the particular database even has a system table)


-Carl
 
if you're using CFMX with mysql, as i am, you can simply do the following:

<cfquery name=&quot;MyQueryName&quot; datasource=&quot;...>
describe table
</cfquery>

<cfdump var=&quot;#MyQueryName#&quot;>

N.B requires MX version of ColdFusion

chau
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top