ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 20th, 2005, 11:47 AM
wonderlandh wonderlandh is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Nottingham UK
Posts: 60 wonderlandh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 48 m 31 sec
Reputation Power: 4
fancy way of outputting a basic SQL query

Hi

If i had a table for translating languages that looked like this:

autoinc. | English | Translation
--------------------------------
1 | one | eins
--------------------------------
2 | two | zwei
--------------------------------
3 | three | drei
--------------------------------

and i has a coldfusion query that looked like this:

<cfquery name = "german">
SELECT Translation
FROM GermanTable
</cfquery>

Would there be a shorthand way that I could output
some of the words e.g.


<cfoutput>
The German word for number one is #german.1st row#
</cfoutput>

or #german.rownumber38#

Or would this require good old javascript?

Reply With Quote
  #2  
Old July 20th, 2005, 12:35 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,742 kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 20 h 59 m 14 sec
Reputation Power: 62
<cfoutput>
The German word for number one is #german.translation[1]#
</cfoutput>
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old July 21st, 2005, 05:31 AM
wonderlandh wonderlandh is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Nottingham UK
Posts: 60 wonderlandh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 48 m 31 sec
Reputation Power: 4
perfect.

thanks!

Reply With Quote
  #4  
Old July 21st, 2005, 09:39 AM
tac's Avatar
tac tac is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 187 tac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 10 m 5 sec
Reputation Power: 6
Also, a nice shorthand way to output the whole table is <cfdump var="#german#">

<!--- Corrected my Error, forgot to encapsulate german with #'s --->

Last edited by tac : July 21st, 2005 at 03:35 PM.

Reply With Quote
  #5  
Old July 21st, 2005, 11:11 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,742 kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 20 h 59 m 14 sec
Reputation Power: 62
Actually just to eliminate a bit of confusion, it's

<cfdump var="#german#">


Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > fancy way of outputting a basic SQL query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT