However, what you are trying to do, this will not work, because it is not guaranteed to be atomic. Thus, two instances of this request, executed in parallel, guarantee that they will interfere with each other at some random point in time, which will lead to missing numbers and duplicate numbers.
The reason that databases offer auto-increment is precisely to solve this problem, guaranteeing atomicity in the generation of these extra values.
(Finally, “Auto Increment Manually” is an oxymoron. It will either be “Auto Increment” or it will be “manual increment.” Just be a smart ass here.)
EDIT (after editing the OP)
One ineffective way to solve your problem is to leave the Position field null or NULL, and then do UPDATE table SET Position = Id WHERE Position IS NULL . (Assuming Id is the auto-typing field in your table.)
An effective but cumbersome way would be to leave the Position NULL field when you haven't changed it, and give it a value only when you decide to change it. Then, every time you want to read the Position field, use the CASE statement: if the Position field is NULL, then use the Id value; otherwise use the Position value.
EDIT2 (after reviewing the OP description in the comments)
If you have only 30 rows, I don’t understand why you are even trying to keep order in the database. Just load all the rows in the array, programmatically assign incremental values to any Position fields that are considered NULL, and when the order of the rows in your array changes, just correct the Position values and update all 30 rows to the database.