Re: [PHP] How Best to Maintain Sort Order Field

2007-04-20 Thread Richard Lynch
On Fri, April 20, 2007 8:06 am, 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_descripti

Re: [PHP] How Best to Maintain Sort Order Field

2007-04-20 Thread Zoltán Németh
2007. 04. 20, péntek keltezéssel 10.47-kor Stephen ezt írta: > Zoltán Németh wrote: > > nothing special. just like this: > > > > > > and then in handler.php do a switch for cmd and update the rows > > accordingly, then redirect back to the form > > > > > Thanks! > > Can you give me idea what t

Re: [PHP] How Best to Maintain Sort Order Field

2007-04-20 Thread Zoltán Németh
2007. 04. 20, péntek keltezéssel 09.45-kor Stephen ezt írta: > Zoltán Németh wrote: > > 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/

Re: [PHP] How Best to Maintain Sort Order Field

2007-04-20 Thread Stephen
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 result

Re: [PHP] How Best to Maintain Sort Order Field

2007-04-20 Thread Zoltán Németh
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

Re: [PHP] How Best to Maintain Sort Order Field

2007-04-20 Thread Wolf
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 t