Suppose I have two list box called UM and AM. UM holds the some information like a,b,d,e,g. AM also holds some fixed information like c,f,h,i,j. Note that, the information of AM will be come from another drop down list which holds group1,group2,... etc.; when I select like group1 then AM display like c,f,h,i,j .
User can add or delete any data from the AM list box. If now, I am add a,e,g in to the AM. When I press the button called Save Change then Only the data of AM will update.What's wrong in my code.
Please answer to me as early as possible.
[CODE]
query.cfm
--------------
<cfparam name="url.Id" default="0">
<cfparam name="url.result" default="">
<cfquery name="save" datasource="CMPM">
Update Module
Set ModuleName='<cfoutput>#url.result#</cfoutput>'
Where CustomerId=#url.Id#
</cfquery>
--------------------------
Mahfuz
Problem With Update DatabaseProblem with Update database
Page 1 of 1
1 Replies - 2725 Views - Last Post: 29 December 2004 - 02:24 AM
Replies To: Problem With Update Database
#2
Re: Problem With Update Database
Posted 29 December 2004 - 02:24 AM
I didn't really understand how you are trying to do what you are trying to do, but looking at your code i found the possible bug.
What you tried to do above is single-quote the parameter url.result
There is a much better way to do that!
The tag cfqueryparam handles the type of the query parameter so you don't need to worry about single-quotes, lists, nulls etc.
If for some reason you don't want to use cfqueryparam then you could also try to use function PreserveSingleQuotes(string). However, i would suggest on using PreserveSingleQuotes if you can't use cfqueryparam.
Quote
Set ModuleName='<cfoutput>#url.result#</cfoutput>'
What you tried to do above is single-quote the parameter url.result
There is a much better way to do that!
Quote
Set ModuleName=<cfqueryparam cfsqltype="cf_sql_varchar" value="#url.result#">
The tag cfqueryparam handles the type of the query parameter so you don't need to worry about single-quotes, lists, nulls etc.
If for some reason you don't want to use cfqueryparam then you could also try to use function PreserveSingleQuotes(string). However, i would suggest on using PreserveSingleQuotes if you can't use cfqueryparam.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|