I have the following code:
$newprice = $ob->pennyauction == 1 ? $oldprice + 0.01 : $oldprice + $plusprice;
I need it to perform the following check before displaying the value of $newprice
.
The rule is to prevent the same value from being written to the DB, for example if you already have 0.02 and it tries to write 0.02 again, the rule should add + 0.01 .
It already does this there, but sometimes it happens to run exactly at the same time, so it inserts the same values, then enter that rule to validate it.
Is there anything to implement there?