2nd set of eyes please

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default 2nd set of eyes please

    This is not a complicated piece of code, but I can't seem to figure out why I
    keep getting this error.

    Context validation error for tag cfif.
    The start tag must have a matching end tag. An explicit end tag can be
    provided by adding </cfif>. If the body of the tag is empty you can use the
    shortcut <cfif .../>.

    The code is below. I would be grateful if someone could help me see what I
    can't seem to see in my code.

    Thanks


    <cfquery name="get_ages" datasource="dbgoose">
    SELECT DATE_FORMAT(rel_date, '%Y') - DATE_FORMAT(birthday, '%Y')
    - (DATE_FORMAT(rel_date, '00-%m-%d')
    < DATE_FORMAT(birthday, '00-%m-%d')) AS age, member_id,division_id
    FROM members,relevant_dates
    WHERE relevant_dates.event='Sign-Up Age Deadline'
    </cfquery>

    <cfoutput query="get_ages">
    <cfif division_id IS 2>
    <cfif age LTE 9>
    <cfquery name="insert1" datasource="dbgoose">
    UPDATE members
    SET age_group_id=1
    WHERE member_id=#get_ages.member_id#
    </cfquery>
    <cfelseif age IS 10>
    <cfquery name="insert2" datasource="dbgoose">
    UPDATE members
    SET age_group_id=2
    WHERE member_id=#member_id#
    </cfquery>

    </cfif>

    <cfelseif division_id IS 3>
    <cfif age IS 11>
    <cfquery name="insert3" datasource="dbgoose">
    UPDATE members
    SET age_group_id=3
    WHERE member_id=#.member_id#
    </cfquery>
    <cfelseif age IS 12>
    <cfquery name="insert4" datasource="dbgoose">
    UPDATE members
    SET age_group_id=4
    WHERE member_id=#member_id#
    </cfquery>
    </cfif>

    <cfelseif division_id IS 4>
    <cfif age IS 13>
    <cfquery name="insert5" datasource="dbgoose">
    UPDATE members
    SET age_group_id=5
    WHERE member_id=#.member_id#
    </cfquery>
    <cfelseif age IS 14>
    <cfquery name="insert6" datasource="dbgoose">
    UPDATE members
    SET age_group_id=6
    WHERE member_id=#member_id#
    </cfquery>
    <cfelseif age GTE 15>
    <cfquery name="insert7" datasource="dbgoose">
    UPDATE members
    SET age_group_id=10
    WHERE member_id=#member_id#
    </cfquery>
    </cfif>

    <cfelseif division_id IS 5>
    <cfif age IS 14>
    <cfquery name="insert8" datasource="dbgoose">
    UPDATE members
    SET age_group_id=6
    WHERE member_id=#.member_id#
    </cfquery>
    <cfelseif age IS 15>
    <cfquery name="insert9" datasource="dbgoose">
    UPDATE members
    SET age_group_id=7
    WHERE member_id=#member_id#
    </cfquery>
    <cfelseif age GTE 16>
    <cfquery name="insert10" datasource="dbgoose">
    UPDATE members
    SET age_group_id=8
    WHERE member_id=#member_id#
    </cfquery>
    <cfelseif age LTE 13>
    <cfquery name="insert11" datasource="dbgoose">
    UPDATE members
    SET age_group_id=9
    WHERE member_id=#member_id#
    </cfquery>
    </cfif>

    <cfelseif division_id IS 6>
    <cfif age LTE 15>
    <cfquery name="insert12" datasource="dbgoose">
    UPDATE members
    SET age_group_id=11
    WHERE member_id=#get_ages.member_id#
    </cfquery>
    <cfelseif age IS 16>
    <cfquery name="insert13" datasource="dbgoose">
    UPDATE members
    SET age_group_id=12
    WHERE member_id=#member_id#
    </cfquery>
    <cfelseif age GTE 17>
    <cfquery name="insert14" datasource="dbgoose">
    UPDATE members
    SET age_group_id=13
    WHERE member_id=#member_id#
    </cfquery>
    </cfif>
    </cfif>

    </cfoutput>

    Bagger Vance Guest

  2. Similar Questions and Discussions

    1. CSS - Need Some Xtra Eyes
      My background color isn't showing in my "content" div. I'm sure it's a mis-key, but I'm just not seeing it. code is posted here at...
    2. Need fresh pair of eyes
      Hey all. I have a flash video recorder set up to do some encoding, and based on the users input to where they want the connection stream to for a...
    3. CRT or LCD / TFT - which one is best for eyes ?
      I still have concerns about the actual radiation levels coming off CRT's. I don't know if it's my middle age, genes or the CRT accelerating my road...
    4. Natural looking eyes?
      I'm having a problem with fixing the red eye (actually WHITE eye) on my pictures. How can I get natural looking eyes when the people have bright...
    5. red eyes fixing
      how can i do, or use. to fix the red eyes in some pictures that i have. i haft to use a filter??, or what can i do. Thanx fo the help
  3. #2

    Default Re: 2nd set of eyes please

    well before the cfif problem, what happens to WHERE
    member_id=#get_ages.member_id# if get_ages has more than 1 row? next what's
    supposed to go here ? WHERE member_id=#.member_id# and you could probably
    eliminate a lot of this complexity if you swapped to using cfswitch/cfcase at
    least for the division_id logic (if that's what your logic is, division
    segregated by age??).



    PaulH Guest

  4. #3

    Default Re: 2nd set of eyes please

    If you fix your indentation, you'll see you've got an extra </cfif> at the
    bottom.
    --

    Adam
    Adam Cameron Guest

  5. #4

    Default Re: 2nd set of eyes please

    Thanks. I had originally tried to set it up as a loop inside a query - thus was
    trying to use the #get_ages.member_id# and apparently when I went back through
    to clean it up, I didn't all of the "get_ages." out from in front of
    "member_id". I also apparently left in some of the "." I guess I was too
    tired to be debugging. Once I corrected those things, the code worked fine.
    There was never supposed to be a group in there.

    Thanks again.

    Originally posted by: PaulH
    well before the cfif problem, what happens to WHERE
    member_id=#get_ages.member_id# if get_ages has more than 1 row? next what's
    supposed to go here? WHERE member_id=#.member_id#

    and you could probably eliminate a lot of this complexity if you swapped to
    using cfswitch/cfcase at least for the division_id logic (if that's what your
    logic is, division segregated by age??).





    Bagger Vance Guest

  6. #5

    Default Re: 2nd set of eyes please

    Oops. I marked the wrong message as the Correct Answer.
    Bagger Vance Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139