How to stop duplicate query on mysql?

hello koders,

there is a value stored in mysql that is 30

i have added a query : get value from mysql + add 40 in it and the store it in mysql again

so that it should be 30 + 40 = 70 and then store 70 in mysql

but when two users runs that query one by one or have difference for about 1 2 secpnds
then it is
1st time = 30 + 40 = 70
2nd time = 70 + 40 = 110
this is ok

but when the two users runs the query at the same time then
1st time = 30 + 40
also 2nd time = 30 + 40
both the times mysql get the same value and add 40 in it and stored it

so this is the question when someone runs a query at the same time mysql get the same value that is 30 .

can we solve this or can we make query async

i didnt found solution on google

I don’t think you looked for the right place.
There are solutions for this.:+1:

where should i get it

and please can you give some hints and then i will reasearch upon that

I β†’ Begin search about β€œI” .

Thankyou I got The Solution

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.