Re: How Best to Maintain Sort Order Field

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

 



2007. 04. 20, péntek keltezéssel 09.31-kor Stephen ezt írta:
> Opps. Sorry
> 
> I meant when I create the category the category_order field is blank.
> 
> I need a strategy to update/maintain then.

yes. I personally do it like when I insert a new record it gets one
bigger than the current max - so it gets to the bottom of the list.
and I provide buttons to move it up/down/top/bottom which do nothing but
adjust the order fields accordingly

greets
Zoltán Németh

> 
> 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