title: Update MySQL with if condition
body: <p>It seems I have big problems with <em>conditional queries</em>.</p>
  
  <p>I have to do a <em>conditional update</em>. I write here what I would like to do:</p>
  
  <pre><code> IF(SELECT tipo FROM abbonamento WHERE idU = 17) = 'punti' THEN
       UDPATE abbonamento SET punti = punti - 1 
   ELSE
       UPDATE abbonamento SET bonus = bonus - 1
  </code></pre>
  
  <p>Obviously this doesn't work.<br>
  Any idea?</p>