Insert order, increment other entries
Posted: Fri Aug 01, 2008 2:51 pm
I'm building a system for users to create/delete pages for a dynamic menu. One of the things I want to be able to do is have the user input a number (any integer) and have that number determine page order. The difficult comes when the user is trying to replace a page in the order. For example:
EXISTING:
Index (1)
Cheese Wiz (2)
Blue Cheese (3)
INPUT:
Cheddar Cheese (2)
now, the order of Cheese Wiz needs to be 3, and Blue Cheese needs to be 4.
Is there any way to increment several rows of data by one all at once? I really don't want to make several queries to update several different pages.
EXISTING:
Index (1)
Cheese Wiz (2)
Blue Cheese (3)
INPUT:
Cheddar Cheese (2)
now, the order of Cheese Wiz needs to be 3, and Blue Cheese needs to be 4.
Is there any way to increment several rows of data by one all at once? I really don't want to make several queries to update several different pages.