I need to re-order via form submission rows in a table with the following structure for a nested page layout
Columns: (table name is: sourcedocs3)
sort1 | sort2 | type
1 | 1 | parent
1 | 2 | child
2 | 1 | no nesting
3 | 1 | parent
3 | 2 | child
3 | 3 | child
4 | 1 | no nesting
I need to be able to re-order (via PHP/Mysql) 3 to 1 without losing basic structure — 3 becomes 1 and all rows with value of 1 are incremented). Sounded simple but I’m having a hard time keeping the structure intact after shuffling (3|1 should be 1|1, 3|2 should be 1|2 etc)
Note that if you were moving a menu to a later position, e.g. moving 2 to 4, you’d want to order the second update in ASCending order.