'MySQL making an index linked field that adjusts based on previous row

Is it possible to create a field whole values automatically populate based on the index field and an adjustment field?

| indexfield | adjustment | adjusted field |
|:----1------|:----------:| ------1-------:|
|:----2------|:----3-----:| -----2-------:|
|:----3------|:----------:| -----5-------:|
|:----4------|:----2-----:| -----6-------:|
|:----5------|:----------:| -----8-------:|

From what you see above, the row includes a reference which will increase based on the prior row's adjustment value.

Furthermore, if I delete a row, it automatically repopulates based on whether or not the prior row has an adjustment value.

This was something I managed to do with Filemaker Pro version 8, but no longer can do with newer Filemaker Pro, and hoped i could do on a server side with PHPMyAdmin and MySQL



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source