But it seems like what he is doing is if the form value is blank, he 
wants to make the database value null, not skip processing.

Thanks!
Robert Bailey



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:316929
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to