title: how to subtract value from 2 columns
body: <p>Using PHP I want to subtract 50 of column <code>coins</code> if have value > 50 , if not then subtract from 'e-coins' .</p>
  
  <pre><code>Users Table:
  
  this is the sample 
  id |user |coins |e-coins| 
  1 |axxx |100 |100 | 
  2 |bxxx |100 |0 | 
  3 |cxxx |0 |100 |
  and this is the result i want
  1 |axxx |50 |100 | 
  2 |bxxx |50 |0 | 
  3 |cxxx |0 |50 |
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>    $db-&gt;Query("UPDATE `users` SET `coins`=`coins`-'50' WHERE `id`='".$sit['user']."'");
  </code></pre>
  
  <p>value in column 'coins' could be 100 
  and i column 'e-coins' could be 100 </p>
  
  <p>I want to subtract from column 'coins'  50 and leave e-coins as it is , but in case column 'coins' have less than 50 or not have any value so subtract from column 'e-coins' 
  How can i do this ?</p>