I have a very simple script bit that changes the status of an item in the MySql database - it works fine in IE7, but if I try it in Firefox, it looks like it worked, but it doesn't exist ... This is very strange.
The code is very simple - first I get the details of the record I'm looking for:
<cfscript>
This works fine if I give the result, it's just the contents of the record, as expected. Therefore, I use the if statement to change the "active" field from one to zero, or vice versa.
<cfif Arguments.qGetProductAttribute.bActive EQ 0> <cfquery name="qChangeStatus" datasource="#Request.sDSN#"> UPDATE tblProductAttributes SET bActive = <cfqueryparam value="1" cfsqltype="CF_SQL_INTEGER" maxlength="1" /> WHERE iProductAttributeID = <cfqueryparam value="#Arguments.iProductAttributeID#" cfsqltype="CF_SQL_INTEGER" />; </cfquery> <cfelseif Arguments.qGetProductAttribute.bActive EQ 1> <cfquery name="qChangeStatus" datasource="#Request.sDSN#"> UPDATE tblProductAttributes SET bActive = <cfqueryparam value="0" cfsqltype="CF_SQL_INTEGER" maxlength="1" /> WHERE iProductAttributeID = <cfqueryparam value="#Arguments.iProductAttributeID#" cfsqltype="CF_SQL_INTEGER" />; </cfquery> </cfif>
I see no reason this should not work ... and indeed, it works fine in IE7 ...
What happens after this script runs, the browser returns to the page on which all these entries are displayed. For each entry, if the "bActive" field is set to "1", it will display the word "Asset", and if it is set to "zero", it will display "Disabled". Simple enough.
If I run a script to turn off the record, Firefox actually displays the word “disconnected” as expected, but the database record does not change!
I’m at a loss ... how does the server code work fine in one browser and not in another ?!
source share