I do this thing:

$res = mysql_query("UPDATE `startpoke` SET life='life - 3' WHERE id_poke='".$_SESSION['id']."'")or die(mysql_error()) ; 

This means that it should subtract 3 from the initial level of life 12, but instead it writes down in the life - 3 column, please tell me what to do =)

  • Your life field type is wrong. In the sense of need numbers, not symbols. - avp
  • 3
    @Prikol give at least play assistants for free? :) - Ozim

1 answer 1

 $res = mysql_query("UPDATE `startpoke` SET `life`=`life`-3 WHERE id_poke='".$_SESSION['id']."'")or die(mysql_error()) ; 
  • you need to specify that it is semi and take it in reverse quotes. Come option ( life - = 3) - Maksym Prus