mysql
#2

Quote:
Originally Posted by BaubaS
Посмотреть сообщение
Hello all, so I have a question about mysql..

I want to update a field like in variables:

something += 5;

because if the field value set to 7, and I want to update +5(7+5=12) and do:

format(something, value, "UPDATE `table` SET `field` = '5' WHERE `something` = '%s'", something); it will set value to 5.. :/
You first need to get the number that is in the table (7). Then you add the variable you stored the 7 in with 5.
Something like that will come out:

pawn Код:
format(something, value, "UPDATE `table` SET `field` = '%i' WHERE `something` = '%s'",VariableThatStoresTheSumOfSevenPlusFive, something);
Reply


Messages In This Thread
mysql - by BaubaS - 20.05.2011, 15:20
Re: mysql - by DeathOnaStick - 20.05.2011, 15:26
Re: mysql - by BaubaS - 20.05.2011, 15:28

Forum Jump:


Users browsing this thread: 1 Guest(s)