Ask a Question related to Coldfusion Database Access, Design and Development.
-
Algoro #1
Unknow name of columns
Hi there, I am new to CF, and I am interested, if it is possible to iterate
through db results, if I don't know names of fields. I think example would be
helpful:
<cfquery name="myquery" datasource="mysqldb">
select * from user
</cfquery>
later I want dynamicaly list all columns and all values without knowing their
names:
1. there is no problem with listing all names:
<cfoutput>
<table>
<tr>
<cfloop list="#myquery.ColumnList#" index="cn">
<th>#cn#</th>
</cfloop>
</tr>
</cfoutput>
2. But how to go through all rows, and in each row through all columns, if I
dont want use column names
I am cusious about something like this
<cfoutput query="myquery">
<tr>
<td>myquery.CurrentRow[1]</td> // - will display value
of 1st column,
<td>myquery.CurrentRow[2]</td> // - will display value
of 2nd column,
....
<td>myquery.CurrentRow[n]</td> // - will display value
of nth column,
</tr>
</cfoutput>
If you know how to do it, please let me know
Algoro Guest
-
Unknow error
We have implemented a plug-in using acrobat 7.0SDK (English version), whose functionality is to find the Links/Bookmarks present in a PDF and display... -
#40072 [NEW]: UTF8 file include output return unknow character.
From: plasmapermanent at msn dot com Operating system: Windows XP SP2 PHP version: 5.2.0 PHP Bug Type: Output Control Bug... -
Unknow error (-108) on launch
I am having troubles with Illustrator CS, I am unable to launch the programme, which haven't been a problem before now. (Sep 2003- may 2004) ... -
Unknow number of columns in repeater
Hi. I have a datatable created at runtime that I want to display using a repeater control. The problem is that the number of columns of the... -
Pad strings/concatenate columns to simulate data columns in ASP select box with SQL Server 2K
Dale, Cast all the data to fixed character data type in your select statement. For example: select cast(au_id as char(12)) +... -
jdeline #2
Re: Unknow name of columns
Go to the Usage section at
[url]http://livedocs.macromedia.com/coldfusion/5.0/CFML_Reference/Tags78.htm#1102316[/url]
are read up on CFQUERY. Note that in CF V5, there are three variables
returned:
query_name.recordCount - The number of records returned by the query.
query_name.currentRow - The current row of the query being processed by
cfoutput.
query_name.columnList - A comma-delimited list of the query columns.
jdeline Guest
-



Reply With Quote

