I'm currently doing some mySQL/PHP but i'm stuck with one small problem. If the user deletes lets say id 4, there's gonna be a gap between sorting 3 and 5. So my thinking is that i need to -(minus) all sort numbers after sort 3 with one.
How do i do that in Mysql? :) I thought it would be something like following, but realize it didn't worked.
UPDATE menucard_category_content SET number_value = number_value-1 AFTER number_value=$sortnr
Table layout looks like:
ID - NAME - SORT - IMAGE
1, pizza, 1, url
2, pizza, 2, url
3, pizza, 3, url
4, pizza, 4, url
7, pizza, 5, url
9, pizza, 6, url
Regards, Simon