I have a query that when the query returns something, it does the
stuff in the <cfoutput Query = "check_registration"> section.  When
it returns no hits, it totally skips the cfoutput.  I'm new to cf and
dbs but our cf guy here says it should do the cfoutput no matter what
and then it should properly do the iff to test whether something was
returned.
So, could someone explain to me why this fails when no records are
returned, but if I take out the Query = "check_registration" and
leave the cfouput, it works fine?  I told him that I'd relay the
answer, but would also like a better understanding myself.  My code:

<cfquery name="check_registration" datasource="css-cffa-sites">
      SELECT *
      FROM bodyfun_registry
      WHERE userName = '#Form.userName#'
</cfquery>
<cfoutput Query = "check_registration">
      in query
      <cfif  check_registration.userName eq '#Form.userName#'>
       okey, done
      <cfelse>
       aw, so messed up
      </cfif>
</cfoutput>

--
Daniel Kessler

Department of Public and Community Health
University of Maryland
Suite 2387 Valley Drive
College Park, MD  20742-2611
301-405-2545 Phone
www.phi.umd.edu
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to