$Energy = 100
$Stats = 50
It takes 5 energy to train and increase $Stats
100/5=20
If <input>
has 20 and <button>
is clicked
20 energy is multiplied by a number
(corresponding with their level) lets say .291 for level 1
20*.291=5.82
What I would like to do then is add this number to $stats
50+5.82=55.82
In the end it should be
$Energy = 0
$Stats = 55.82
I have the <form>
already set up. I just don't know how to update the two numbers at the same time. They are both on the same table in the same database.
I hope this is clear enough