RE: Tree Display
| From: | Mikusch, Rita | Date: | Mon, 30 Jul 2001 15:28:09 +0000 |
| Subject: | RE: Tree Display | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-10905@lists.php.net to get a copy of this message | ||
Have your table set up with the following two fields (among others!):
-Category
-Parent
"Result1" parent = 0 (it has no parent). "Item1" parent is "Result1"
(ie the
"parent" field of item1 is "result1"'s unique identifier).
"Item2" parent is
"Result1". "Result2" parent = 0. "Result2"'s "children"
have "Result2" as
their parent.
Now you have to write the PHP code so that the corrent items are display. If
no "results" are clicked then display all "results" in a column.
"Result1"'s URL would be something like "samepage.php3?result=result1".
Have
PHP code that checks if you have a value for "Result" then displays that
result's "items" . . . and if you have a value for "result1" and
"item1"
then display the items for "result1" and the content for "item1".
I use a tree display for website menus and submenus. And I've created an
entire administrative interface that makes it really easy to move sections
of the trees around. It makes it really easy when people come to me at the
last minute and want me to rearrange some part of the main menu, or add a
whole section.
You should be able to use this from other tree structures like "product
lists", etc etc.
Hope this makes sense . . .
Rita.
-----Original Message-----
From: Sharif Islam [mailto:mislam@students.uiuc.edu]
Sent: Friday, July 27, 2001 2:13 PM
To: php-db@lists.php.net
Subject: Tree Display
I am still trying to figure out how to do it. I want to display my result
from the data base in tree/menu like system.
So the result page will look like this:
+Result1 (you click this , it will expand)
-Item1 (you click this and get more info)
-Item2
-Item3
+Result2
-Item1
-Item2
All the records will be pulled from the same table.
Any hint?