thesavior
07-27-2007, 01:09 AM
Okay, here is something slightly complicated and I am trying to figure out the fastest and smoothest way to do the following.
I couldnt post my mysql datat in a visible way on this forum, so im linking to a text file, the mysql structure and test data is at the top:
http://eli-white.com/files/table%20information.txt
The way I want to get things to display is:
Songs
->Genre
->Albums
->Artists
-->Green Day
-->Flyleaf
--->Singer
-->Atreyu
->Title
Movies
->Genre
->Actors
But for the sake of you understanding how things would get organized that way I added the rest of the corresponding row information after the formatting:
Name ID SORT ORDER (Parent Ids) (Child Ids)
Songs 1 1 ( )- (2,3,5,9)
->Genre 2 1 (1) ()
->Albums 3 2 (1) ()
->Artists 5 3 (1) (4,6)
-->Green Day 6 1 (5,1) ()
-->Flyleaf 4 2 (5,1) (8)
--->Singer 8 1 (4,5,1) ()
-->Atreyu 7 3 (5,1) ()
->Title 9 4 (1) ()
Movies 10 2 () (11,12)
->Genre 11 1 (10) ()
->Actors 12 2 (10) ()
So for example, it would find all the rows where is_cat is 1, then sort those by the sort order. Then, it would go to the first category it just found and find all the forums right under that (forums where id is in the category's child ids). Then after that it would continue to cascade through each forum finding all the forums where the id is in the parent forum's child ids.
If that made any sense then thats great, otherwise please ask for me to re-explain something.
I couldnt post my mysql datat in a visible way on this forum, so im linking to a text file, the mysql structure and test data is at the top:
http://eli-white.com/files/table%20information.txt
The way I want to get things to display is:
Songs
->Genre
->Albums
->Artists
-->Green Day
-->Flyleaf
--->Singer
-->Atreyu
->Title
Movies
->Genre
->Actors
But for the sake of you understanding how things would get organized that way I added the rest of the corresponding row information after the formatting:
Name ID SORT ORDER (Parent Ids) (Child Ids)
Songs 1 1 ( )- (2,3,5,9)
->Genre 2 1 (1) ()
->Albums 3 2 (1) ()
->Artists 5 3 (1) (4,6)
-->Green Day 6 1 (5,1) ()
-->Flyleaf 4 2 (5,1) (8)
--->Singer 8 1 (4,5,1) ()
-->Atreyu 7 3 (5,1) ()
->Title 9 4 (1) ()
Movies 10 2 () (11,12)
->Genre 11 1 (10) ()
->Actors 12 2 (10) ()
So for example, it would find all the rows where is_cat is 1, then sort those by the sort order. Then, it would go to the first category it just found and find all the forums right under that (forums where id is in the category's child ids). Then after that it would continue to cascade through each forum finding all the forums where the id is in the parent forum's child ids.
If that made any sense then thats great, otherwise please ask for me to re-explain something.