Note that there are some explanatory texts on larger screens.

plurals
  1. POSimple ColdFusion script works in IE but not Firefox?
    text
    copied!<p>I have a very simple bit of script that changes the status of an item in a MySql database - it works fine in IE7, but if I try it in Firefox, it looks like it's worked, but hasn't... Which is extremely odd.</p> <p>The code is very simple - first I get the details of the record I'm looking for:</p> <pre><code>&lt;cfscript&gt; // Get the Product Attribute details Arguments.qGetProductAttribute = Application.cfcProducts.getProductAttributes(Arguments.iProductAttributeID); &lt;/cfscript&gt; </code></pre> <p>This is working fine, if I dump the results, it's just the content of the record as expected. So then I use an if statement to change the 'active' field from one to zero or vice versa.</p> <pre><code>&lt;!--- If Product Attribute is active, mark as inactive ---&gt; &lt;cfif Arguments.qGetProductAttribute.bActive EQ 0&gt; &lt;cfquery name="qChangeStatus" datasource="#Request.sDSN#"&gt; UPDATE tblProductAttributes SET bActive = &lt;cfqueryparam value="1" cfsqltype="CF_SQL_INTEGER" maxlength="1" /&gt; WHERE iProductAttributeID = &lt;cfqueryparam value="#Arguments.iProductAttributeID#" cfsqltype="CF_SQL_INTEGER" /&gt;; &lt;/cfquery&gt; &lt;!--- Else if Product Attribute is inactive, mark as active ---&gt; &lt;cfelseif Arguments.qGetProductAttribute.bActive EQ 1&gt; &lt;cfquery name="qChangeStatus" datasource="#Request.sDSN#"&gt; UPDATE tblProductAttributes SET bActive = &lt;cfqueryparam value="0" cfsqltype="CF_SQL_INTEGER" maxlength="1" /&gt; WHERE iProductAttributeID = &lt;cfqueryparam value="#Arguments.iProductAttributeID#" cfsqltype="CF_SQL_INTEGER" /&gt;; &lt;/cfquery&gt; &lt;/cfif&gt; </code></pre> <p>I can't see any reason whatsoever for this not to work... and indeed, in IE7 it works perfectly...</p> <p>What happens is after this script is run, the browser goes back to the page that displays all of these records. For each record if the 'bActive' field is set to '1', it will display the word 'Active' and if it's set to 'zero', it will display 'Disabled'. Simple enough.</p> <p>If I run the script to disable a record, Firefox actually displays the word 'disabled' as expected, but the database record doesn't change!</p> <p>I'm at a loss... how can server-side code work fine in one browser and not in another?!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload