[PHP-DB] RE: Tree Display

2001-07-30 Thread Mikusch, Rita

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:[EMAIL PROTECTED]]
Sent: Friday, July 27, 2001 2:13 PM
To: [EMAIL PROTECTED]
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?




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Tree Display

2001-07-28 Thread Dennis

Hi,Maybe you can use Javascript to do it.Namely,you get your menu's content
from DB with PHP or others,and set its to Javascript 's array.

Try it!

Dennis




"Sharif Islam" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> 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?
>
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Tree Display

2001-07-27 Thread Hugh Bothwell


"Sharif Islam" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> 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.

Could you give us your SELECT statement and one row of returned data?


> 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

The expanding tree bit is done in JavaScript, see
http://kmserv.com/testbed/tree/smith_jstree.html
for a simple tutorial.

What you need to do is use PHP to write the JavaScript to
create the tree according to your query results.




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]