Steve...just for your information. It is good practice and almost 
imperative for your to use cfqueryparam with your cfquery to avoid sql 
injection attacks. This is a security measure that you should start 
getting yourself in the habit of doing it. Also, once you get this query 
to update, look into cftry and cfcatch. Every time you make a trip to 
the database, you are better off having a cftry/cfcatch around your 
cfquery to catch on possible errors. It makes life easier when you need 
to debug.

For now, I know you are trying to get this work but once you do get this 
query to work, get back at me and I will show you some error handling 
and security tips for your query.

Ravi Gehlot.

Ravi Gehlot wrote:
> Hello Steve,
>
>     Set your table to accept NULL and wrap your cfquery around with a 
> cfif. This way, you will only run the query if you need to. You will 
> save unnecessary trips to the database if there is no value being passed 
> by the form variable.
>
> Example:
>
> <cfparam name="FORM.alert" default="" />
> <cfif len(FORM.alert)>
>     <cfquery name="qryUpdate" datasource="text">
>           update alert set
>              alert = '#FORM.alert#'
>           where alert = '#FORM.alert#'
>     </cfquery>
>     <cflocation url="../../status1.cfm?msg=succeed.">
> <cfelse>
>     <cflocation url="../../status1.cfm?msg=fail.">
> </cfif>
>  
> Also, make sure your method is set to POST on your form in order for the 
> form variables to be passed correctly.
>
> Also, your table will not update if alert is not equal to FORM.alert.
>
> Ravi Gehlot.
>
>   

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316930
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to