How Best to Maintain Sort Order Field

From: Date: Fri, 20 Apr 2007 13:06:48 +0000
Subject: How Best to Maintain Sort Order Field
Groups: php.general 
Request: Send a blank email to php-general+get-253333@lists.php.net to get a copy of this message
I have created some PHP scripts that use MySQL to organize the photographs on my web site. They are grouped into categories and the table for categories has these fields: Category_id Category_order Category_name Category_description When creating a category, the category_id field is blank I want to create another form to allow populating and/or changing this field and then updating the database. I will select all category rows, dynamically build the form and update the database, of course. But the next level of detail is not clear to me. What should I make the form look like? Can I do it so that after the update order values will always go from 1 to n where n is the number of categories? Thanks Stephen

« previous php.general (#253333) next »