Phillip,


In the CFQUERY tag, you define the name of the query as "display".  So the
later CFIF statement should read CFIF Display.CurrentRow... instead.  When
you took out the "error_table" part, CF looked through the available
variable scopes and found the data somewhere, but it may have been looking
in another query.  Changing it to explicitly refer to Display.CurrentRow
should fix the problem.


HTH,
Matthieu

-----Original Message-----
From: Phillip Perry [mailto:[EMAIL PROTECTED]
Sent: Monday, October 11, 2004 1:24 PM
To: CF-Talk
Subject: currentrow is undefined?

Thanks for the info from my last question. Now here is my next issue. I am
calling for information from 2 tables. I want to find out which row is even
and which is odd from one of them. I'm using. <cfif error_table.CurrentRow
MOD 2 IS 1>  but this throws an error saying that currentrow is undefined.
Yet if I take out the error_table. part it works, without ever finding the
odd and even rows. I'm trying to use this to format the bgcolor and txtcolor
of a <tr> & <td>. The code is below. How do I fix this error.

<cfquery datasource="#mydbname#" name="display">
SELECT *
FROM error_table, importance
</cfquery>

<cfoutput query="display">
<cfif error_table.CurrentRow MOD 2 IS 1>
<cfset bgcolor="white">
<cfset txtcolor="black">
<cfelse>
<cfset bgcolor="black">
<cfset txtcolor="white">
</cfif>
<tr bgcolor="#bgcolor#" style="text-color:#txtcolor#;">

Thanks for the help

Phil
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to