title: Delete entire row when a column reaches 0?
body: <p>So I have this database table "userDeck", with three columns: idUser, idCard, amount. Amount is a counter that keeps track of how many cards the user has added of a specific card. Right now I'm using this query:</p>
  
  <pre><code>$query1 = "UPDATE userDeck SET amount=amount-$amount WHERE idCard=$idCard"; 
  $result2 = mysql_query($query1) or die(mysql_error());
  </code></pre>
  
  <p>when the user wants to delete cards he/she added. </p>
  
  <p>This works just fine except it continues below 0 if you delete more cards than you have listed. I want it to remove the row when amount reaches 0. </p>