Looks like section is reserved in QoQ. Try
<cfloop from="1" to="3" index="i">
<cfquery dbtype="query" name="section">
SELECT *
FROM questions
WHERE [section] = #i#
</cfquery>
</cfloop>
----------------------------------------
From: "Kris Sisk" <[email protected]>
Sent: Thursday, April 29, 2010 3:34 PM
To: "cf-talk" <[email protected]>
Subject: What's wrong with this QoQ?
This is driving me batty. Every time I try to run this code I get a QoQ
syntax error and I'm not seeing where the error is.
<cfloop from="1" to="3" index="i">
<cfquery name="section" dbtype="query">
SELECT *
FROM questions
WHERE section = #i#
</cfquery>
</cfloop>
In case it's not immediately obvious, section is an int with possible
values ranging 1-3. I've double checked that it actually is in the
questions query. Other variations I've tried are:
WHERE section = '#i#'
WHERE section = 1
WHERE section = '1'
WHERE section = 'WHY WON'T YOU WORK!!!' (ok, so I didn't try that one).
It seems no matter what I put in the where statement it throws a QoQ error.
If I leave the where statement off completely it works fine, but that's
pretty useless in this situation. What am I doing wrong?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333265
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm