Put some #'s in there value="#getTG.tg#"

Ade

-----Original Message-----
From: Colin Coles [mailto:[EMAIL PROTECTED]
Sent: 04 October 2005 10:55
To: CF-Newbie
Subject: Form variable in a where clause


Users log on and select their class group:
<!--- Select Tutor Group from table in database --->
    <tr>
      <td valign="top">Tutor Group:</td>
          <td colspan="2">
                <cfselect size="1" name="TG" required="yes" class="smallform"
message="Please select your tutor group.">
                        <cfoutput query="GetTg"><option
value="#GetTg.tg#">#GetTg.tg#</option></cfoutput>
                </cfselect>
        </td>
    </tr>
I'd like to use the selected value in a second <cfquery> that uses their
selection as the filter in a where clause. At the moment I have:
<cfset TG ="">
<cfquery name="getName" datasource="sports_qs">
        SELECT name, tg
        FROM tblNames
        WHERE tg = <cfqueryparam value="getTG.tg" cfsqltype="cf_SQL_VARchar">
</cfquery>
I have varied the syntax but either get TG is undefined or the selection
boxes show but no names appear in the list.
I would appreciate the wisdom of anyone who has experience of this.
Many thanks for having a look.
Colin


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:15:1403
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to