Since CF6 referencing a row greater than the record count, even one of 0,
doesn't cause an error.
In fact, all of these "work"...
#qArticles["ArticleID"][-10]#
#qArticles["ArticleID"][0]#
#qArticles["ArticleID"][1000]#
.... regardless of the record count of qArticles. Which has it's benefits :O)
Ade
-----Original Message-----
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
Sent: 23 March 2005 14:32
To: CF-Talk
Subject: RE: nesting variables...
or #countryName[region][1]# if the query is only supposed to return a
single row - the problem of course will occur if the query returns no
rows, then [1] (or any number) will produce an error whereas
#countryName.myregion# would return an empty string. So if there's any
doubt that the query might ever be empty, you end up needing something
like this <cfif
countryName.recordcount>#countryName[region][1]#</cfif>
> #countryName[region][countryName.currentrow]#
> -----Original Message-----
> From: Protoculture [mailto:[EMAIL PROTECTED]
> Sent: 23 March 2005 11:15
> To: CF-Talk
> Subject: nesting variables...
> I have defined a variable earlier in my template titled
> region. and it
> equals a string of my location... ie. CAN or US.
> I also have a query titled countryName.
> <cfquery name="countryName" datasource="#datasource#">
> select #region# from location where id = #form.location#
> </cfquery>
> So how could I use that region varible in order to access
> the data retrieved
> from my query like so below ( both versions throw an error
> )...
> #countryName[region]# OR #countryName[#region#]#
s. isaac dealey 954.522.6080
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.0 - Release Date: 21/03/2005
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:199753
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54