Ask a Question related to Macromedia ColdFusion, Design and Development.
-
Bagger Vance #1
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
-
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... -
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... -
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... -
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... -
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 -
PaulH #2
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
-
Adam Cameron #3
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
-
Bagger Vance #4
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
-
Bagger Vance #5
Re: 2nd set of eyes please
Oops. I marked the wrong message as the Correct Answer.
Bagger Vance Guest



Reply With Quote

