|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Retreiving fields from Access DB, Cold Fusion
I am retreiving all fields from a certain table in my Access DB and want to output the data in those fields on my page. The table is specified by the URL parameter, so I need the output to correspond with the correct table. So i cant simply just <cfoutput>#fieldname#</cfoutput> because the field names are different for each table.
Basically, is there a way to output all the info in a table without specifying the field names? Like a <cfoutput>#ALL#</cfoutput> or something????? My code: <cfquery datasource="XX" name="getRecords"> <cfset table = URL.record> SELECT * FROM #table# </cfquery> <cfloop query="getRecords"> <cfoutput> </cfoutput> </cfloop> Thanks for your help, hope you understand what I'm saying! |
|
#2
|
||||
|
||||
|
#queryname.ColumnList# will give you a comma-delimited list of the query columns
you can loop over those with a cfloop inside the main cfoutput |
|
#3
|
|||
|
|||
|
I'd be throwing up a huge red flag on this approach, unless you truly have no security concerns. For example, if you have a table with user names and passwords, it would be trivial for a malicious user to alter the URL parameter and end up with a full list of all your users and passwords. Be careful.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Retreiving fields from Access DB, Cold Fusion |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|