• You are not logged in. | Login

Post a reply

December 22, 2006 9:11 am

admin
Administrator
Administrator

Discuss article: "Working with MySQL. Trees"

Leave your comments here

Discussed article: "Working with MySQL. Trees"


 

 

April 5, 2007 7:33 am

sirburpsalot
Member
Ranks

Re: Discuss article: "Working with MySQL. Trees"

Thanks, I just thought about it a couple of weeks ago. I was going to attach tree-form structure to my comments and also came to the conclusion that it is enough to add one parameter only – level.

It’s a well-known trick: if you want something to work faster you need more memory value and conversely if the base value is important you may find way out at the expense of speed looses.


 

 

April 5, 2007 7:51 am

biopd42
Member
Ranks

Re: Discuss article: "Working with MySQL. Trees"

The approach is rather interesting BUT…

It could be all right… But suddenly I need to transfer element 7 with (or without) saving the entire structure under, for instance, element 5. I will have to lots of corrections!!! And what if there are lots elements within structure of 7?

Of course, I mean that case only when sorting is important and it can be managed.


 

 

April 5, 2007 8:01 am

sirburpsalot
Member
Ranks

Re: Discuss article: "Working with MySQL. Trees"

Why do you worry so much? From my point of view you don't need level at all.


 

 

April 5, 2007 8:24 am

bobbee
Member
Ranks

Re: Discuss article: "Working with MySQL. Trees"

Left indent is done taking into account level field.

What for? It’s quite possible to calculate the indent with formula length(sortorder)/2 (for this case).
I.e. level field is likely to be unnecessary.
To reduce sortorder field you may convert each number added to the string into another calculation system (for example, with base of 128 instead of the one with 10) – and the string is going to reduce a bit.


 

 

April 5, 2007 8:54 am

steven9x
Member
Ranks

Re: Discuss article: "Working with MySQL. Trees"

Thanks. I got to know dbTree.

Could you tell me how to change the children’s order (I mean a procedure which placed the set node before the indicated one)?


 

 

April 5, 2007 9:28 am

tucansam
Member
Ranks

Re: Discuss article: "Working with MySQL. Trees"

Some time ago I used what had been done in forum but because of the impossibility to choose a branch without having examined the whole tree I crossed to the model used on frashmeat, sourceforge, gforge and so on. Of course, administration scripts are more complicated – they should be placed on cron but in general everything is much easier and more convenient. At this one element can be placed into some categories at the same time.


 

 

April 5, 2007 9:41 am

Re: Discuss article: "Working with MySQL. Trees"

This algorithm works until you have a necessity to display all sub elements to this element.


 

 

April 5, 2007 9:55 am

bandlist12
Member
Ranks

Re: Discuss article: "Working with MySQL. Trees"

Everything is OK. The only thing which lacks is $max variable calculation. It’s a pity. The author should simply have forgotten to copy this string. And without it str_pad() doesn’t work. And following sortorder won’t have desirable zeroes.


 

 

April 5, 2007 10:02 am

mdwb
Member
Ranks

Re: Discuss article: "Working with MySQL. Trees"

Has someone tried to enumerate tree’s branches automatically?
like
1.
1.1
1.2
1.2.1
1.2.2
....... and so on??


Don't be afraid of life, it is yours!

 

 
  • Actions
  • Top
ITCrimea. Ukraine Web Development Company. Professional Developers and Web Designers Team
Custom Web Designs, Internet Applications, E-Commerce Websites, Interactive Sites, Database-Driven Sites and Services