Answered
Email form with drop-down selection
I have an email form where the recipients are chosen from
combinations of drop-down boxes. The email form works just fine,
unless the user chooses more than one item from any of the
drop-downs (by using the CTRL key).
This is the form: http://edcollege.ucf.edu/clexp/admin/email/emailbyinternshiptest.cfm
And here is the query I am using:
<cfquery name="q_GetInternship" datasource="#DSN#">
select * from Applications
where
<cfif Len(form.Int_ID)>
Int_type = <cfqueryparam value="#form.Int_ID#">
AND
</cfif>
<cfif Len(form.Major)>
Major = <cfqueryparam value="#form.major#">
AND
</cfif>
<cfif Len(form.county)>
county = <cfqueryparam value="#form.county#">
AND
</cfif>
1 = 1
</cfquery>
Anyone has an idea of how I can fix this problem? Thank you in advance!
This is the form: http://edcollege.ucf.edu/clexp/admin/email/emailbyinternshiptest.cfm
And here is the query I am using:
<cfquery name="q_GetInternship" datasource="#DSN#">
select * from Applications
where
<cfif Len(form.Int_ID)>
Int_type = <cfqueryparam value="#form.Int_ID#">
AND
</cfif>
<cfif Len(form.Major)>
Major = <cfqueryparam value="#form.major#">
AND
</cfif>
<cfif Len(form.county)>
county = <cfqueryparam value="#form.county#">
AND
</cfif>
1 = 1
</cfquery>
Anyone has an idea of how I can fix this problem? Thank you in advance!