RE: CFQUERY Update......
Does it return an error in CF? Some thoughts: Make sure that the ID field is a NUMBER field and the ID # is unique. -Original Message- From: JL [mailto:[EMAIL PROTECTED]] Sent: Friday, May 25, 2001 9:46 AM To: CF-Talk Subject: CFQUERY Update.. Hi all, I am trying to update a table using CFQUERY. I do not see any error when the query is excuted in CF and I can see the query is correct in the debug mode. But somehow the data is not updated. When I run the same query in SQL Server, the data is updated. Does anybody know why? I am using CF 4.5 and SQL Server 7.0 The query is like this.. UPDATE User SET newpassword = 'arenofun' WHERE ID = 1614 Thanks in advance J ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: CFQUERY Update......
I have seen this behavior before under heavy load without using transactions, but it did not happen every time like you are seeing. An update will of course execute but not change the data if the where clause does not match anything. If you can copy the same query into Query Analyzer that shows in the debug and it updates where the cfquery did not, you might want to try moving the query into a stored procedure. Since it works in sql server, might as well keep it there ;-) jon - Original Message - From: "JL" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Friday, May 25, 2001 9:46 AM Subject: CFQUERY Update.. > Hi all, > > I am trying to update a table using CFQUERY. I do not see any error when the > query is excuted in CF and I can see the query is correct in the debug mode. > But somehow the data is not updated. When I run the same query in SQL Server, > the data is updated. Does anybody know why? I am using CF 4.5 and SQL Server > 7.0 > > The query is like this.. > > UPDATE User > SET newpassword = 'arenofun' > WHERE ID = 1614 > > Thanks in advance > > J > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: CFQUERY update Firefox wierdness
Hi I never seen that.. but the first thing I would look at is to set up a way to see how many times that action page is run. Perhaps insert a GetTickCount counter into a log file when the action page is run.. First look to see how it works in IE, then try firefox. At 06:55 PM 4/18/2011, you wrote: >Hi Everyone, > >I have a really strange issue that I can not figure out how to fix it. I >have a simple shopping cart and everything works exactly the way it should >in ie7 & ie8 but firefox not so much. >This is the issue. When customer clicks on the item to add to cart it first >checks to see if the item is already in the cart. If not, insert new >record. If found, update the record and add 1 to the qty. Within IE this >works just as it should, Firefox runs the update query regardless of new >insert or not. example. item ABC new to cart with qty 1 if I look at the >database table I see the qty is 2. If the item is already in database with >qty 1 and item is added to cart the qty is now 3. I've turned on debug and >looked at all queries ran and the the correct queries do show. > >It's like there is another update query someplace but there isn't. I tested >this by removing the query named "updatecart" and tried the process again >and new records do get added and the qty is correct with 1 not 2. With it >being removed and item is updated to cart. it doesn't get updated like it >should be. > >This is very very weird! > >The code that I'm having strange is the following. I just copied the bit >that I need to show. >Anybody seen this before? > >Thanks, >Dan Blickensderfer > > >username="#application.username#" password="#application.password#"> >select rec_id >from order_items >where rec_status = 'T' and session_uuid = cfsqltype="cf_sql_varchar" maxlength="36" value="#session.cartid#"> and >products_rec_id = value="#variables.recid#"> > > >username="#application.username#" password="#application.password#"> > insert into order_items (rec_status, session_uuid, products_rec_id, >product_name, qty, orders_rec_id, ip_address) >values ('T', value="#session.cartid#">, >, >value="#getproduct.product_name#" maxlength="150">, >, >value="#lookuporder.rec_id#">, >value="#trim(cgi.REMOTE_ADDR)#" maxlength="17">) > > >username="#application.username#" password="#application.password#"> > update order_items > set qty = qty + 1 > where rec_status = 'T' and rec_id = cfsqltype="cf_sql_integer" value="#lookupcart.rec_id#"> > > > > >Here is the debug info > >lookupcart (Datasource=XYX, Time=0ms, Records=0) in >templates\includes\cart-add.cfm @ 18:50:44.044 > > select * > from order_items > where rec_status = 'T' and session_uuid = ? > and products_rec_id = ? Query >Parameter Value(s) - >Parameter #1(cf_sql_varchar) = 69B9132F-943D-2A28-E56878FCFEA4A5B6 >Parameter #2(cf_sql_integer) = 17 > >addcart (Datasource=XYX, Time=0ms, Records=1) in >templates\includes\cart-add.cfm @ 18:50:44.044 > > insert into order_items > (rec_status, session_uuid, products_rec_id, >product_name, qty, orders_rec_id, ip_address) > values ('T', ?, > ?, > ?, > ?, > ?, > ?) > Query Parameter Value(s) - >Parameter #1(cf_sql_varchar) = 69B9132F-943D-2A28-E56878FCFEA4A5B6 >Parameter #2(cf_sql_integer) = 17 >Parameter #3(cf_sql_varchar) = Green, Yellow & Orange >Parameter #4(cf_sql_integer) = 1 >Parameter #5(cf_sql_integer) = 5014 >Parameter #6(cf_sql_varchar) = 192.168.10.159 > > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343834 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFQUERY update Firefox wierdness
tag has absolutely nothing to do with any browser - it is executed by cf on the server side. i would check your page's html and javascript instead - that's where browser differences can come into play. how do you submit your form to add item to cart - ajax or regular form submit? how do you display updated cart info on the page - ajax or page refresh? is your html correctly formed and does it validate properly? ff is pickier than ie when it comes to malformed html and this may cause it to submit other data to your cart update script than what you expect. use firebug to check what form data really gets submitted in ff. Azadi On 19/04/2011 06:55 , Dan Blickensderfer wrote: > Hi Everyone, > > I have a really strange issue that I can not figure out how to fix it. I > have a simple shopping cart and everything works exactly the way it should > in ie7& ie8 but firefox not so much. > This is the issue. When customer clicks on the item to add to cart it first > checks to see if the item is already in the cart. If not, insert new > record. If found, update the record and add 1 to the qty. Within IE this > works just as it should, Firefox runs the update query regardless of new > insert or not. example. item ABC new to cart with qty 1 if I look at the > database table I see the qty is 2. If the item is already in database with > qty 1 and item is added to cart the qty is now 3. I've turned on debug and > looked at all queries ran and the the correct queries do show. > > It's like there is another update query someplace but there isn't. I tested > this by removing the query named "updatecart" and tried the process again > and new records do get added and the qty is correct with 1 not 2. With it > being removed and item is updated to cart. it doesn't get updated like it > should be. > > This is very very weird! > > The code that I'm having strange is the following. I just copied the bit > that I need to show. > Anybody seen this before? > > Thanks, > Dan Blickensderfer > > > username="#application.username#" password="#application.password#"> > select rec_id > from order_items > where rec_status = 'T' and session_uuid = cfsqltype="cf_sql_varchar" maxlength="36" value="#session.cartid#"> and > products_rec_id = value="#variables.recid#"> > > > username="#application.username#" password="#application.password#"> > insert into order_items (rec_status, session_uuid, products_rec_id, > product_name, qty, orders_rec_id, ip_address) > values ('T', value="#session.cartid#">, > , > value="#getproduct.product_name#" maxlength="150">, > , > value="#lookuporder.rec_id#">, > value="#trim(cgi.REMOTE_ADDR)#" maxlength="17">) > > > username="#application.username#" password="#application.password#"> > update order_items > set qty = qty + 1 > where rec_status = 'T' and rec_id = cfsqltype="cf_sql_integer" value="#lookupcart.rec_id#"> > > > > > Here is the debug info > > lookupcart (Datasource=XYX, Time=0ms, Records=0) in > templates\includes\cart-add.cfm @ 18:50:44.044 > > select * > from order_items > where rec_status = 'T' and session_uuid = ? and > products_rec_id = ? Query > Parameter Value(s) - > Parameter #1(cf_sql_varchar) = 69B9132F-943D-2A28-E56878FCFEA4A5B6 > Parameter #2(cf_sql_integer) = 17 > > addcart (Datasource=XYX, Time=0ms, Records=1) in > templates\includes\cart-add.cfm @ 18:50:44.044 > > insert into order_items (rec_status, > session_uuid, products_rec_id, > product_name, qty, orders_rec_id, ip_address) > values ('T', ?, > ?, > ?, > ?, > ?, > ?) > Query Parameter Value(s) - > Parameter #1(cf_sql_varchar) = 69B9132F-943D-2A28-E56878FCFEA4A5B6 > Parameter #2(cf_sql_integer) = 17 > Parameter #3(cf_sql_varchar) = Green, Yellow& Orange > Parameter #4(cf_sql_integer) = 1 > Parameter #5(cf_sql_integer) = 5014 > Parameter #6(cf_sql_varchar) = 192.168.10.159 > > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343835 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFQUERY update Firefox wierdness
Wild guess: Firebug is turned on and is adding a second "click" to the flow. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343836 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFQUERY update Firefox wierdness
I checked and it's turned off. This is happening from multiple computers with Firefox. Any other thoughts? -Original Message- From: Matt Quackenbush Sent: Tuesday, April 19, 2011 12:20 AM To: cf-talk Subject: Re: CFQUERY update Firefox wierdness Wild guess: Firebug is turned on and is adding a second "click" to the flow. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343840 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFQUERY update Firefox wierdness
On 19/04/2011 8:46 PM, Dan Blickensderfer wrote: > > I checked and it's turned off. This is happening from multiple computers > with Firefox. > > Any other thoughts? in that case turn it on and look at what the browser is sending... -- Yours, Kym Kovan mbcomms.net.au ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343842 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFQUERY update Firefox wierdness
Kym, I figured out what was causing the page to load twice. Within my page I had an abandon background-image:url(); within one of my style tags. Once I removed it everything is working correctly with Firefox on all machines. I guess Firefox tries to fetch the url() and since it's not referring to a url it reloads the same page. This was driving me crazy. Dan -Original Message- From: Kym Kovan Sent: Tuesday, April 19, 2011 7:23 AM To: cf-talk Subject: Re: CFQUERY update Firefox wierdness On 19/04/2011 8:46 PM, Dan Blickensderfer wrote: > > I checked and it's turned off. This is happening from multiple computers > with Firefox. > > Any other thoughts? in that case turn it on and look at what the browser is sending... -- Yours, Kym Kovan mbcomms.net.au ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343858 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm