hi guys had a search but couldnt find the answer to this
i want to add to the figure in one of my tables instead of just using the update command which just replaces the figure i want it to add to the figure ie
if the table has a figure of 1 in there and i add 2 i want it to add the 2 to the 1 and make 3
is this possible ?
using PHP and Mysql
That's done by using update...
UPDATE table SET field = field +2
wow thats quick 🙂 thanks but can you be a bit more specific please as i'am new to all this heres the code i use at the moment
$sql = "update wing set gkill = \"$gkill\" WHERE callsign = \"$callsign\"";
and that only changes the table to the figure i added previously
To the figure you added previously?
Let's assume the number you want ot add to is $addMe, ok?
$addMe = 2; $sql = "UPDATE wing SET gkill = gkill + ".$addMe." WHERE callsign = '".$callsign."'"; mysql_query($sql);
LordShryku
thankyou very much buddy worked like a charm 🙂
ya, just do like column=column+2