Dusty
asked on
Coldfusion Form submit / SQL question
I have added "multiple" to my select dropdown, but I'm not sure how to adjust my SQL query on the action page to compensate for multiple city selections? Any help appreciated!
<cfselect name = "City" query = "city" value = "City" queryPosition="below" selected = "#prefillCity#" class="selectpicker show-menu-arrow span6" multiple>
<option value=" ">All Cities</option>
</cfselect>
<!---QUERY ON FORM ACTION PAGE--->
<cfquery name="listings" datasource="datasource" result="result">
SELECT * from res INNER JOIN seo on res.Listid = seo.Listid
WHERE 0=0
<!---Search by City--->
<cfif StructKeyExists(form,"City ") and len(trim(form.City))>
AND City = '#form.City#'
</cfif>
<cfselect name = "City" query = "city" value = "City" queryPosition="below" selected = "#prefillCity#" class="selectpicker show-menu-arrow span6" multiple>
<option value=" ">All Cities</option>
</cfselect>
<!---QUERY ON FORM ACTION PAGE--->
<cfquery name="listings" datasource="datasource" result="result">
SELECT * from res INNER JOIN seo on res.Listid = seo.Listid
WHERE 0=0
<!---Search by City--->
<cfif StructKeyExists(form,"City
AND City = '#form.City#'
</cfif>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER