I'm trying to shift an column of sequential numbers (auto-incremented, unique). I need to increment all the numbers above a certain number set by the user so I can insert a record into the space i just created. Kinda like this, if the user enters 2
1 -> 1 stays same
2 \
3 > 3 shifts down
1
<- 2 insert here
3
4
The problem is that mysql won't let me shift the numbers because they need to be unique and it hits a duplicate for 3. I'm using this:
UPDATE table SET id = id+1 where id >= $number_entered
Tried this but got an error:
UPDATE german SET id = id+1 where id >= $number_entered order by id desc
Ideas? Please?