Chris->Re: [PHP] Category and sub-category logic

From: Date: Sun, 17 Aug 2003 17:44:55 +0000
Subject: Chris->Re: [PHP] Category and sub-category logic
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-159850@lists.php.net to get a copy of this message
Hey, Sorry I didnt reply, was having some computer problems. Thanks for the link and the advise, will look into it. Cheers, -Ryan We will slaughter you all! - The Iraqi (Dis)information ministers site http://MrSahaf.com ----- Original Message ----- From: "Chris W. Parker" <cparker@swatgear.com> To: "David Otton" <phpmail@jawbone.freeserve.co.uk>; "Ryan A" <ryan@jumac.com> Cc: <php-general@lists.php.net> Sent: Friday, August 15, 2003 2:04 AM Subject: RE: [PHP] Category and sub-category logic > David Otton <mailto:phpmail@jawbone.freeserve.co.uk> > on Thursday, August 14, 2003 4:58 PM said: > > > The advantage of doing it this way is that your tree structure is > > generic and can have many levels. The disadvantage is that you may > > need many SQL queries to fully traverse the tree (though people > > rarely want to do this, and sub-selects, clever joins or post-query > > processing can reduce the overhead). > > Which is why you should use the Modified Preorder Tree Traversal method > instead. With that method you've got one table that defines the > categories AND their relationships to each other. > > Your SQL queries end up looking something like this. > > SELECT name > FROM categories > WHERE lft >= x > AND rgt <= y > > > > Chris. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#159850) next »