title: SQL Query seems to be executing twice
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7538120/insert-query-on-page-load-inserts-twice">Insert query on page load, inserts twice?</a>  </p>
  </blockquote>
  
  
  
  <p>I'm hoping someone can help with a problem that's driving me up the wall. I've searched but found nothing directly answering this.</p>
  
  <p>I have a problem on a website where an SQL INSERT query seems to run twice but only on some occasions.</p>
  
  <p>It's a simple shopping site. On my product page there is an 'Add To Cart' button. On pressing this a user is taken to the Cart page, and various variable are passed across. An INSERT query is run when the page loads and the results are displayed in the shopping cart.</p>
  
  <p>This all works fine most of the time, but on some occasions, the product is added to the database twice. </p>
  
  <p>The problem is not related to any specific product. Since it works OK the majority of the time, I'm pretty confident the code is OK. The only thing I can say is that I have not as yet seen the problem outside of Firefox. Some people have suggested turning of the 'Disable Cache' via Toolbar, which I have, but still getting problems.</p>
  
  <p>Very grateful for any suggestions.</p>