Hey@

Although I am very new to CF, I read this in the ColdFusion Docs last night. If the query returns no records, it will skip the CFOUTPUT completely! This drove me nuts for hours and hours before I found this in the online docs. :-)

HTH
Kevin
  ----- Original Message -----
  From: Daniel Kessler
  To: CF-Talk
  Sent: Wednesday, March 17, 2004 3:25 PM
  Subject: failing when query is named.

  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