Skip to main content
Participant
March 24, 2008
Question

CFIF Tag

  • March 24, 2008
  • 3 replies
  • 374 views
Dear All,

Hope someone can help me. Here's the deal. When I use the following code, I get nothing on my page:

<cfquery USERNAME="tsglawcom" PASSWORD="eTWUMCc4" DATASOURCE="tsg" name="jobs">
SELECT * FROM Jobs </CFQUERY>
<CFOUTPUT QUERY="jobs">

<CFIF Status ='A'><UL><LI>'#Title#'</LI></UL>
<CFELSE></CFIF> </cfoutput>

If I lose the CFIF/CFELSE tags all of my employment entries display, using a simple CFOUTPUT QUERY COMMAND, However. as soon as I put in the code above in place, I error out with:

Invalid CFML construct found on line 46 at column 14.
ColdFusion was looking at the following text:

=

The CFML compiler was processing:

* A CFIF tag beginning on line 46, column 2.
    This topic has been closed for replies.

    3 replies

    BKBK
    Community Expert
    Community Expert
    March 25, 2008
    V.K.R. wrote:
    The '=' will only work in coldfusion 8

    I think you mean '=='.

    Astonished_protector15C3
    Participating Frequently
    March 25, 2008
    Hi

    The '==' will only work in coldfusion 8 <cfscript> tag.

    other wise you have to use EQ instead of '=='

    Thx BKBK for correcting my mistake
    Inspiring
    March 24, 2008
    mojoman01 wrote:
    <CFIF Status ='A'>

    You need a comparison operator like IS or EQ, not "=".

    <cfif Status EQ 'A'>
    ....
    </cfif>