It seems I have big problems with conditional queries.
I have to do a conditional update. I write here what I would like to do:
IF(SELECT tipo FROM abbonamento WHERE idU = 17) = 'punti' THEN
UDPATE abbonamento SET punti = punti - 1
ELSE
UPDATE abbonamento SET bonus = bonus - 1
Obviously this doesn't work.
Any idea?