I had a mysql database that when I add a new value such as 2.5 I wanted to re-order the column with integer numbers (whole). The data column was a decimal(4,1).
Or in other words – a MySQL auto increment but just resetting values back to an even order using PHP.
Would be renamed like this
This code will use an sql query to increment a column value by 1.
Use the code as below (change the column names of course!
UPDATE mytable SET mycolumn = @i:=(@i+1) WHERE 1=1 order by mycolumn;