I'm looking for a simple to use php function to move a navigation link up or down in the database. My table is setup using the the parent format. For example:
auto_id | link name | parent | text
1 | About | 0 | text text
2 | Mission | 1 | text text
3 | Contact | 0 | text text
4 | Forms | 0 | text text
(Where Mission is the child of About)
I would like the administrator of the cms to be able to move Forms about Contact in the navigation if they wish. I guess it could work with adding a new column, order, and assigning numeric values to each. I could then query the table where parent = 0, get the current orders and swap the orders for Forms and Contact. But is there an easier way? Does anyone have this code already written?
Thanks a ton,