title: update a column by subtracting a variable
body: <p>the sql query doesn't seem to work ... where am I wrong?</p>
  <pre><code>$barcode = $_GET['barcode_from_index2'];
  $amountofsales = $_GET['amount_of_sales'];
  
  if($amountofsales &lt; 1)
  {
  echo &quot;quantity must be greater than zero&quot;;    
  }
  
  else{
  $sql = &quot;UPDATE inventary SET quantities_left='quantities_left - $amountofsales' WHERE Cod_product='$barcode'&quot;;  
  </code></pre>