Re: How Best to Maintain Sort Order Field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Opps. Sorry

I meant when I create the category the category_order field is blank.

I need a strategy to update/maintain then.

Stephen

Wolf wrote:
IMO, you don't WANT to change that behavior. The category_id should remain as a auto-fill field for the database itself, then just sort the results of your categories by name or order instead of by id when displaying out to the page.

HTH,
Wolf

Stephen wrote:
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





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux