That didn’t come out like I was thinking it lol

ItemID  | ItemName  |  ParentID

1  |  Item1  |  0
2  |  Item2  |  1
3  |  Item3  |  1
4  |  Item4  |  3
5  |  Item5  |  3


Would be...

Item1
...Item2
...Item3
.....Item4
.....Item4

Thanks for the link. 
I've never used 'nested sets' ill see what I can dig up on that too.

 
..:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com

-----Original Message-----
From: Anthony Prato [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 21, 2005 5:43 PM
To: CF-Talk
Subject: Re: SOT: data structure for unlimited nested items

As far as I know, using mysql and the parentid setup you'll have to
make a recursive function to go an unlimited number of levels.

the nested sets are tricky at first, but worth checking out. You can
get queries of subtrees and geneology in one sql statement each.



On 10/21/05, Bobby Hartsfield <[EMAIL PROTECTED]> wrote:
> Thanks for the response.
>
> I guess I should have mentioned that it's MySQL.
>
> I'm thinking that I could do something like...
>
> itemID
> ItemTitle
> ItemURL
> ItemParentID
>
> And parent ID would just point to another record in the same table if the
> item was indeed a sub item of another item. That items 'parent' could then
> also point to another item as its parent, etc...
>
> And maybe just a 0 for parentID when the item is 'top level'.
>
> I've used this before but I've always known exactly how deep the nests
would
> go which in turn let me know exactly how many nested loops I would need to
> build everything
>
> ..:.:.:.:.:.:.:.:.:.:.:.:.:.:.
> Bobby Hartsfield
> http://acoderslife.com
>
> -----Original Message-----
> From: Anthony Prato [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 21, 2005 5:19 PM
> To: CF-Talk
> Subject: Re: SOT: data structure for unlimited nested items
>
> If you use oracle the whole id,parentid setup can work ok. If it gets
> slow you can just generate an xml file for the site to use for
> menus/sitemap each time an update is done in the admin panel, or if
> it's really slow, leave it to a manual button push. Personally what
> I've used in the past is a method of storing a nested structure in a
> relational database called Nested Sets. Its very cool once you get the
> hang of it. Don't have my links with me but try googling it. Pretty
> sure it's been brought up here before too. There used to be a great
> overview slideshow out there but i can't find it at the moment
>
> Anthony
>
> On 10/21/05, Bobby Hartsfield <[EMAIL PROTECTED]> wrote:
> > I've been racking my brain trying to come up with a feasible solution to
a
> > dynamic site map for a current project. Normally it would be a
no-brainer
> > but this time, the site is HUGE and has nested section after section
after
> > section...
> >
> > Once the client receives the final application, they will be adding even
> > more sections (and undoubtedly subsections).
> >
> > I'd like to come up with a way to build the site map dynamically so I
(and
> > eventually they) can just add any new section's title and URL to the
> > database.
> >
> > Without knowing exactly how deep the nests will go, it's proving to be
> > tough.
> >
> > I'm curious to know if anyone else has done something similar with a
site
> > map or a menu or something that dynamically gave the ability to add
> > unlimited nested items and if so what your database structure looked
like.
> >
> > Thanks for any ideas.
> >
> > ..:.:.:.:.:.:.:.:.:.:.:.:.:.:.
> > Bobby Hartsfield
> > http://acoderslife.com
> >
> > --
> > No virus found in this outgoing message.
> > Checked by AVG Anti-Virus.
> > Version: 7.0.344 / Virus Database: 267.12.4/143 - Release Date:
10/19/2005
> >
> >
> >
> >
> >
>
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:221877
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to