I
I
Ivan Ivanov2018-04-22 14:26:34
PHP
Ivan Ivanov, 2018-04-22 14:26:34

How to add a value to a field from the database?

How to add a value to a table field? For example, the number 50 is stored there, and when replenishing the balance, a number, for example 100, should be added. Of course, you can first take the balance value, add and update, but I would like to immediately add the desired number.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Daniil Sukhikh, 2018-04-22
@danchiksux

You display the current balance from the database, add to the current balance by how much you need to increase it.
The resulting number is entered into the database.

Z
Zhainar, 2018-04-22
@zhainar

As an option, put the replenishment in the hotel table. At replenishment you interpose simply record in this table.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question