Created
January 22, 2013 02:39
-
-
Save despeset/a642878c96b82b21b52c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- Build a query of tags ---> | |
<cfset qTags = QueryNew('id,tag') /> | |
<cfset QueryAddRow(qTags, 3) /> | |
<cfset QuerySetCell(qTags, 'id', 1, 1) /> | |
<cfset QuerySetCell(qTags, 'id', 2, 2) /> | |
<cfset QuerySetCell(qTags, 'id', 3, 3) /> | |
<cfset QuerySetCell(qTags, 'tag', 'Kitchen', 1) /> | |
<cfset QuerySetCell(qTags, 'tag', 'Blue', 2) /> | |
<cfset QuerySetCell(qTags, 'tag', 'Happy, smiling', 3) /> | |
<!--- This will only return 1 and 2 ---> | |
<cfquery name="qTest" dbtype="query"> | |
SELECT id FROM qTags | |
WHERE tag IN (<cfqueryparam CFSQLType="CF_SQL_VARCHAR" value="#ValueList(qTags.tag)#" list="Yes" />) | |
</cfquery> | |
<!--- You can see the cause in the dump, the params are wrong. ---> | |
<cfdump var="#qTest#" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment