Seeking strategy/algorithm for maintaining order of records
| From: | Stephen | Date: | Sun, 16 Oct 2011 00:57:19 +0000 |
| Subject: | Seeking strategy/algorithm for maintaining order of records | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-315317@lists.php.net to get a copy of this message | ||
I am building a site for my photography.
The photographs are displayed by category.
The category table has a field for "order"
In my control panel I want to be able to change the order of the categories by changing the values in the category field.
I can dynamically build a form of all categories and have a field for new order number, Then loop through the POST and update the values.
The field is not unique, so I am not worried about DB errors.
But I wonder if there is a better way.
Thoughts please?
Thank you
Stephen