Use CFQUERYPARAM to avoid SQL injection attacks.

<CFQUERY name="myquery">
 Select *
 from mytable
 where id = <cfqueryparam value="#form.yourfield#"
cfsqltype="CF_SQL_VARCHAR">
</CFQUERY>

Ray Thompson
Tau Beta Pi (www.tbp.org)
The Engineering Honor Society
865-546-4578 
-----Original Message-----
From: David Mineer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 29, 2007 7:46 AM
To: SQL
Subject: Re: Creating output based on CFSelect result

This is more of a coldfusion questions for another list.  One way to
do that, if I understand you correctly, is to create a page that
simply uses #form.yourfield# in the query.

The action part of your form would point to another page that contains
something like this:

<CFQUERY name="myquery">
 Select * from mytable where id = #form.yourfield#
</CFQUERY>

<CFOUTPUT query="myquery>
#field1#, #field2#
</CFOUTPUT>

You could also use a cfdiv to display this newly created ajax and bind
it to the cfselect making it load without a new page having to come
up.

HTH

On 8/29/07, Paul Smith <[EMAIL PROTECTED]> wrote:
> Using MYSQL 5.0, CF8 & Dreamweaver CS3
>
> Ok so thanks to Brian my CFSelect box now contains DISTINCT data (cheers!)
>
> Now I need to display all records that contain the selection from that
CFSelect box
>
> what I don't know is how and where the CFSelect returns the data chosen
and also how to create a SQL to incorporate that selection to then display
the data I want.
>
> Like I said i'm a newbie and a thick one at that :(
>
> I do think once this bit is sorted I should be able to complete my little
project so any help is greatly appreciated.
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2922
Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6

Reply via email to