Re: SV: building tree view in mysql?

2002-06-06 Thread Kiss Dániel
ount++; > > } > > } > > } > > == > > > > Please note that cat_list is given as a by-reference parameter. >Otherwise > > you'd be copying the whole array for each recursive function c

Re: SV: building tree view in mysql?

2002-06-06 Thread Patrick Näf
atabase at once (instead of calling a mysql SELECT statement for each > branch of the tree). > > - Carsten > > > -Oprindelig meddelelse- > > Fra: Carsten Gehling [mailto:[EMAIL PROTECTED]] > > Sendt: 27. maj 2002 20:33 > > Til: [EMAIL PROTECTED] > > E

Re: SV: building tree view in mysql?

2002-06-06 Thread Patrick Näf
database at once (instead of calling a mysql SELECT statement for each > branch of the tree). > > - Carsten > > > -Oprindelig meddelelse- > > Fra: Carsten Gehling [mailto:[EMAIL PROTECTED]] > > Sendt: 27. maj 2002 20:33 > > Til: [EMAIL PROTECTED] > > E

SV: building tree view in mysql?

2002-05-27 Thread Carsten Gehling
branch of the tree). - Carsten > -Oprindelig meddelelse- > Fra: Carsten Gehling [mailto:[EMAIL PROTECTED]] > Sendt: 27. maj 2002 20:33 > Til: [EMAIL PROTECTED] > Emne: SV: building tree view in mysql? > > > Well you'll neew to do some coding in your application langua

Re: building tree view in mysql?

2002-05-27 Thread Sagi Bashari
he database once > (for optimum performance). > > - Carsten > > > -Oprindelig meddelelse- > > Fra: Sagi Bashari [mailto:[EMAIL PROTECTED]] > > Sendt: 27. maj 2002 20:50 > > Til: olinux; [EMAIL PROTECTED]; [EMAIL PROTECTED] > > Emne: Re: building tree

SV: building tree view in mysql?

2002-05-27 Thread Carsten Gehling
ra: Sagi Bashari [mailto:[EMAIL PROTECTED]] > Sendt: 27. maj 2002 20:50 > Til: olinux; [EMAIL PROTECTED]; [EMAIL PROTECTED] > Emne: Re: building tree view in mysql? > > > > Yeah, thats exactly what I wanted to do. But how do I make MySQL sort it > like that? Show the paren

Re: building tree view in mysql?

2002-05-27 Thread Sagi Bashari
Yeah, thats exactly what I wanted to do. But how do I make MySQL sort it like that? Show the parent first, and then all its childs, so the application can determite if it's subcategory by checking if the parent is was changed. Sagi From: "olinux" <[EMAIL PROTECTED]> > create a table like this

Re: building tree view in mysql?

2002-05-27 Thread olinux
create a table like this: id | parent_id | category parent_id points to the parent categories id. Top level categories get parent_id of '0' ex: 1 | 0 | auto 2 | 1 | repair 3 | 2 | body 4 | 2 | windshields 5 | 1 | detailing 6 | 2 | tires Tree would look like: auto repair body wi

Re: building tree view in mysql?

2002-05-27 Thread hassan
HI, >For trees you need self joins. Could You please explain that ? Regards, At 19:11 23/05/02, Georg Richter wrote: >On Thursday, 23. May 2002 16:16, Sagi Bashari wrote: >Hi, > > > > > > How can I get MySQL to sort it like that? I tried to use group/order by, > > but I cannot get it

RE: building tree view in mysql?

2002-05-23 Thread Xavier Pr?lat
so it depends on your client! Hope It helps... -Message d'origine- De : Sagi Bashari [mailto:[EMAIL PROTECTED]] Envoy? : jeudi 23 mai 2002 16:16 ? : [EMAIL PROTECTED] Objet : building tree view in mysql? Hi, I'm trying to build a simple categories tree in MySQL. Say

Re: building tree view in mysql?

2002-05-23 Thread Georg Richter
On Thursday, 23. May 2002 16:16, Sagi Bashari wrote: Hi, > > How can I get MySQL to sort it like that? I tried to use group/order by, > but I cannot get it to sort it this way.. > > Any ideas? For trees you need self joins. Regards Georg mysql, query -

building tree view in mysql?

2002-05-23 Thread Sagi Bashari
Hi, I'm trying to build a simple categories tree in MySQL. Say I have the following table: CREATE TABLE test ( id int(10) unsigned NOT NULL auto_increment, parent int(10) unsigned NOT NULL default '0', name tinytext NOT NULL, PRIMARY KEY (id), KEY parent (parent) ) TYPE=MyISAM; +---