Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Generating Tree View!


My problem is simple though I am not too sure if the solution is.
I need to generate a tree view by using the data I have stored in the
database.For example in the root I have stored SportsBrand now if I
click on SportsBrand it will expand to show different names such as
Addidas,Nike,Reebok etc.Again if I click on Addidas I will have
different items such Shoes,T-shirts etc.I want to list the tree on
the left side of the screen and once the user click the items s/he
will see the related information on the right of the screen.Also if
the user want to add any new brand it will be shown dynamically under
the SportsBrand along with the items they are producing. Also if the
user want to delete any brand I have to make sure the tree structure
will be resized again.

xampp(The development IDE) is using this Tree view.

I have already progressed a bit by storeing the tree in database and
running the queries.Now I need to develop the user interface and
mapped it with the backend.

Is there any tool in PHP that will help me to do this? I think in
NETBEANS(Java IDE) they have a built in tool to generate this
structure.




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Tree/category View Database Using PHP
i wan to develop a site using a database in a tree or category navigation sistem. say like a webdierctory which contans data in catogorised way or a e-book download site that is in categorisedd way of data..

How can i design my data base to do in that way? any idea, suggestion or soLid link frOm where i can learn that stretegy?

View Replies !   View Related
Tree View Dropdown Menu
I have such a categories MySQL table: ID | name | parent and have such a function that displays the categories in a SELECT element as a drop-down menu:

function DD_ProjectCategories($parent=0) {
include("db.php");
$query = "SELECT ID,name FROM categories";
$result = mysql_query($query) or die(mysql_error());
echo '<select name="parentcategory">'
echo '<option value="">Choose a parent category</option>'
echo '<option value="0">Root Category</option>'
while ($row = mysql_fetch_array($result)) {
echo "<option value="$row[0]""; if ($parent == $row[0]) {echo " selected"; } echo ">$row[1]</option>";
}
echo "</select>";
unset($query,$result,$row);
}.....

View Replies !   View Related
How Do You Tell If A Page View Is A Direct Hit, Iframe View, Or Other
How can one tell if a hit on a PHP page was generated from an iframe, object/img tag, or a direct hit?

View Replies !   View Related
N-ary Tree
Someone knows about a php class (free)
that let me handle n-ary tree and store them
on a db?

View Replies !   View Related
Tree Creation?
I was wondering if anyone had any experiencing creating 'trees' from databases. IE: The navigation tree in explorer, or GMC. ANY and ALL help would be highly appreciated. I'm doing this in ASP, but I'm truly just looking for over-all methods. Thanks in advance.

Meditation upon the topic has enlightened me to the fact that my problem could also be likened to a BBS reply system that allows nested replies (reply to a reply sorta thing).

View Replies !   View Related
Tree Creation
i have created a visitor-logging-script that saves the visited pages into a table. The table looks like this: PHP Code:

View Replies !   View Related
Tree Array
I have a simple problem, but I don't found a solution for my problem.
I'm try, try and not found. If anybody help me, I very, very thankful
for this help.

Here is my problem:

I have a table with following data I have access:

page_id
page_path
page_depth
page_order
page_has_childs
page_title

I make chages add this fields to make a breadcrumbs functionality from
this system in the following fields I have stored this data:

page_id page_path page_depth page_order page_has_childs
page_title
1 x 1 0 1 Home
2 x.1 2 0 1 Products
3 x.1 2 2 0 3D Cad
9 x.1.2 3 2 0 Contact
10 x.1.2 3 0 0 Knowledge

In page path I store the location from that row data, for example in
page_id 10, I have the following path x(Home), 1(Products) and
2(Knowledge). In breadcrumbs I'm show like this Home > Products >
Knowledge.

My problem is, I need make a array tree with all data from database to
make a website map.

View Replies !   View Related
Implementing A Tree
I'd like to implement a tree of "tags" for a blog I'm writing for fun in PHP.
Here's what a single tag looks like:

CREATE TABLE tags
(
name varchar(30) not null default '',
id_self integer(12) not null primary key,
id_parent integer(10) not null default 0,
);
INSERT INTO tags VALUES ('root of the tree', 0, 0);

Each tag has a name, a unique id to identify itself with and a parent's id,
and all this will be stored in a database, but stored in no particular order.

I'm a little stumped as to how to reconstruct the tree. Part of the problem
is that suppose my first read to the database yeilds:

name = "physics"
id_self = 21
id_parent = 2

but further down in the database, this record exists:

name = "science"
id_self = 2
id_parent = 0

in other words, it's possible that children may be read before parents.

I've noticed that some people have implemented a tree class. Since this is
supposed to be a *fun* project for me, I'd rather write it myself. But I
find myself staring at the keyboard, not knowing how to start.

View Replies !   View Related
Tree Functions
I need a tree (of folders), can anyone give me some ideas/input, how
do I control collapse, explode etc?

Showing the entire tree will be too much, so I need to show a part of
it only....

View Replies !   View Related
Directory Tree
I need to be able to select the start location of the tree, then place it in a drop down menu... If possible, I would like to format the drop down menu too (Formating isn't a big deal, not nessesary).

View Replies !   View Related
Display In Tree
How to display the list of names in tree format. Under Name all the names should be displayed. Code:

View Replies !   View Related
W/ Tree Expanding
the thing is that descentant branches i dont want to expand do expand. $id variable contains an array of branches i want the program to go through (alcohol's id -beer id etc)

function tree_list($parent, $level,$id) {
// retrieve all children of $parent

$result = mysql_query('SELECT cname,cid FROM kategorie '.
'WHERE parent="'.$parent.'";');
while ($row = mysql_fetch_array($result)) {
echo str_repeat('&nbsp;&nbsp;',$level).$row['cname']."<br/>
";

if ($row['cid']==$id[$level])
$this->tree_vypis($row['cid'], $level+1);
}
}

View Replies !   View Related
Copy Or FTP A Dir Tree
I was wondering if there's any existing FTP scripts out there, to avoid starting from scratch.
Obviously, you'd want to use many of the FileSystem fx's.

I wrote a File Mgt System, that did a tree copy, on the MR files, based on filemtime().
It was far from elegant, to begin with, but proved useful eventually. Because I wanted to preserve the file date and time, after using copy(), I had to use touch() to restore the date-time

Re: FTP a directory tree

I'm now exploring the porting my TreeCopy program over to be used as FtpTreeCopy.
I've seen references to Phing (a cousing to Java's ANT), and a few mixed reviews. I'd need to learn this quickly, to use it; I know alot of ANT's commands are almost like batch commands.

I guess this FTP promote functionality would be part of any CVS system. I am a single developer, and so far have not used a CVS system, but would be open to the idea, especially if it would have handy features and would be available at reasonable cost (or open-source).

View Replies !   View Related
TREE Command
I notice both unix and windows have the tree command for viewing a systems files from the current dir downwards. Is there anyway in PHP which I could use this command and make a tree with all the directories clickable? So users could go to them directories?

Or what are others ways for navigation, basically one function I have for instance is copy, a user selects a file to copy and on the next screen is presented with a textbox to type wheer to copy in. It would be nice if I could have something graphically for them to click on and then update the box. Anyknow know anything on this or resources, anything in PEAR?

View Replies !   View Related
Add Element To The DOM Tree
The code displays hello as soon as the user clicks on the button but the text dissappears as soon as the click button is released. Why is it not static ? Is it because of the onClick event? Code:

View Replies !   View Related
Decision Tree
I have a page that deletes an entry in a MySQL db. There is no safety check though. So, I would like the question posted first, by button or hyperlink.

e.g. Are you sure you wish to delete this entry? Yes, delete No, do not delete

<?

include('dbconnect.inc');
mysql_query("DELETE FROM products WHERE ProductID='$id'");

mysql_close();

header("Location: admin.php");
?>

View Replies !   View Related
Family Tree
I'm trying to output a family tree. I've used recursive function for single parent things - like unlimited recursive menus/submenus. But this is more difficult because of the 2 parents. Code:

View Replies !   View Related
Tree Menu
does somebody know a db structure in mysql as well as a SINGLE mysql query to get a Menu in form of a tree?

Example of such a tree menu:

cat1
--subcat1
----subsubcat1
----subsubcat2
----subsubcat3
--subcat2
cat2
cat3

salutations

View Replies !   View Related
About Tree Menu
The problem is i can`t get The Idea How to make it whit Mysql database the problem is i needt to use something like this PHP Code:

<?php
$menu  = new HTML_TreeMenu();
$node1   = new HTML_TreeNode(array('text' => "First level", 'icon' => $icon, 'expandedIcon' => $expandedIcon, 'expanded' => false));

###################################################

function show_menu($id=0, $path="",$k = 0,$b ='') {
        $k++;
        #echo $k;
        $all = mysql_query("SELECT id, name FROM ".$_SESSION[_sesion_u_id_."_db_prefix"]."main WHERE sadid=$id ORDER BY poz ASC")or die(mysql_error());

View Replies !   View Related
Tree Structure Question.
Currently I'm using a tree like sections structure, e.g. Code:

Table: sections
+--------+------------+----------+
| sec_id | sec_parent | sec_name |
+--------+------------+----------+
| 1 | 1 | Home |
| 2 | 1 | News |
| 3 | 2 | Sports |
| 4 | 3 | Soccer |
| 5 | 4 | Teams |
| 6 | 5 | Arsenal |
| 7 | 1 | World |
| 8 | 7 | England |
| 9 | 8 | Economy |
+--------+------------+----------+

Also I'm using the function below to cover the tree: PHP Code:

View Replies !   View Related
Tree Data Structure
I'm facing an issue concerning tree data structure in php.
In others languages, I just need to create a root node which I bind
pointers of instances representing others nodes.
But I couldn't find a way to do so in php language. Indeed, object
instances are "volatile" reaching the end of the script. How could I
build a tree with "volatile" address pointers in php ?
I could use arrays to store data like a tree structure but I'd like to
find another way..

View Replies !   View Related
Counting Nodes In A Tree
I have a simple tree structure where node x can have y children.
Node x's children are stored in an array.
I want to supply a node to a function and count the TOTAL number of
children for that node.
This is what I have come up with so far:

function count_total_children($tree)
{
$num_of_c = $tree->get_num_child();
echo $num_of_c.'+'
$child_array = $tree->get_child_arr();

for($i=0;$i<$num_of_c;++$i)
{
count_total_children($child_array[$]);
}
}

Now this clearly does not work but its the closest I've come. What
this bit of code does is if a node has 5 children it will output
something like:

1+2+0+0+2+

Rather than print out the number I need to add it to a running total,
but I just cant seem to do it!

Ive tried using references but it doesnt work when you do the
recursive call?

View Replies !   View Related
Family Tree Approach
I've been working on a simple database for my family to keep our family tree organized.  I've written all the pages to handle inputing the data into the database, but am getting stuck on the best approach for pulling it all out into a family tree.  I want to keep things simple, so I only want it to display parents (no siblings).

However, I'd like the code to be flexible, so it will go as many generations as the database has data for.  I've looked around at a couple of other posts and came across one for a dog pedigree that is essentially the same thing, though it was limited in it's generations.  I've done a bit of research and came across this http://en.wikipedia.org/wiki/Ahnentafel  but I'm not sure if this would actually help me at all.

Right now, my mySql table is set up with an ID field, and then fields for the ID's of that entry's mother and father, along with other relevant data.  I'm basically just not sure on what the best way is to cycle through the database and pull everything out.  I'll worry about the formating later, but right now I'd like to just achieve something like this example http://en.wikipedia.org/wiki/Ahnentafel#Example.

View Replies !   View Related
Flash Sending Xml Tree To Php
Were having trouble reading the xml tree inside php, in the documentation it should have been posted and with sendAndLoad vars the key is the corresponding object name in flash.

So for the flash xml we have..

xmlOUT.sendAndLoad(this.path, xmlRTN);

but in php
echo $_POST['xmlOUT']; doesnt work.

View Replies !   View Related
Format Tree Traversal
I'm using a tree traversal to store categories.. What I want to do is use the php to format how the categories are displayed.. For example, I'm getting the depth of the node, so a result set might look like this Code:

View Replies !   View Related
Smarty Tree Menu
I am searching a way to make a tree menu for categories using php and smarty but as i am not very familiar with smarty syntax i cant do it with the functions i know. So here is what i have done: Code:

View Replies !   View Related
Dhtml Tree Menu.
header.php:
Will header.php wrapped in php echo statement prevent Dhtml tree menu from working.

It halts with an error on Line 19:
expected comma or semi-colon...

document.write('<style type="text/css">
')

I remove the echo wrap and pasted in the variables and now the menu will not expand.
DynamicDrive script Switchmenu.

View Replies !   View Related
LDAP -&gt; Directory Tree
We run an LDAP server that has an attributed "reporto" that tells us who reports to who.

I need to create a "tree" like the diagram attached, it's basically going to end up like a Folder directory structure, it'll create an XML file and it'll use JavaScript to create the tree from the XML file, but I need to output the XML file first.

I'm at an impass on how to get it to recursively run through and create the file. I've tried numerous routes, the latest was creating a user-defined array of the ldap_search array results, but alas, it's not working.

I need to start at the top and find who reports to the Pres, then those that report to the pres, find who reports to them and so on down the line.

Negate the need to connect/bind/search LDAP, I have that figured out, unless something different needs to happen with the search to get the results better.

View Replies !   View Related
Dynamic Tree Structure
urgent help with PHP dynamic tree structure/ hierarchal view. I'm unable to post the scrips here coz it's a big file.

View Replies !   View Related
Tree Built Recursive
I want to read the folder hierarchy of the webserver and store the
information in a tree, built like a linked list - you know 'a tree'.

you see in function readsubtree() i'm storing the object child in the
array of the actualfoldernode. but this doesn't work out. it never
arrives there. Code:

View Replies !   View Related
Subtrees Ids Of Categories Tree
categories table

categoies_id, parent_id
1, 0
2, 0
3, 0
4, 2
5, 2
6, 5

I want to find all the categoreies_id of the subtree, such as for the categories_id as 2. the subtree ids set will be (2, 4, 5, 6). Code:

View Replies !   View Related
Tree Like Diagram In MySQL
do any body has the idea for how to implement the tree diagram/organizational chart using GD Library I want to have dynamic chart like the one given below.

View Replies !   View Related
Recursive(?) Tree Function
I've been cracking my head on this one for the past 24+ hours and i
have tried creating the function in ten different ways and none of the
versions i've made works exactly as it should.

I have an array called $PageArray which contains a sorted list of all
pages in my application. Im trying to create a recursive function(It
dosn't need to be recursive if it can be done in another way) which
loops thorugh the $PageArray and writes some DIV and SPAN tags arround
certain parts so i can create a javascript tree from it Code:

View Replies !   View Related
Tree Structure Of Directory
Is there any tutorial website showing how to use dreamweaver MX 2004 to do the PHP or ASP.net for building a tree structure of image directory like photo gallery which has its own name of directory and inside of the directory has its own photos along with posting date, posting information.

View Replies !   View Related
Create Directory Tree
The function needs to determine the parent directory that currently exists (such as /public_html/images/) in the given path and then create the subdirectories below it (such as /public_html/images/bears/beats/battle_star_galactica/).

function ftp_newdir($dir)
{
require ''.$_SERVER['DOCUMENT_ROOT'].'/includes/config.php';

$dirs_desc = array();
$this_dir = $dir;
$preamble = "/home/danstewa";

if(!$conn_id = ftp_connect($ftp_server))
{
$errors[] = "Could not connect to ".$ftp_server;
}

if(!$login_result = ftp_login($conn_id, $ftp_user, $ftp_password))
........

View Replies !   View Related
Help Needed With Tiger Tree Hashes
I am trying to generate tiger tree hashes the same way as directconnect
does, but I am failing.

I checked the output from php with the reference vectors from
http://www.cs.technion.ac.il/~biham...ssie-format.dat
and they appear to be different!

echo bin2hex(mhash(MHASH_TIGER, 'abc'))."<br/>";
outputs
f258c1e88414ab2a527ab541ffc5b8bf935f7b951c132951
instead of
2AAB1484E8C158F2BFB8C5FF41B57A525129131C957B5F93

and, for example,
echo bin2hex(mhash(MHASH_TIGER, 'message digest'))."<br/>";
outputs
951a2078cbf881d91c441e754830cf0df6295aa51aca7f51
instead of
D981F8CB78201A950DCF3048751E441C517FCA1AA55A29F6

What am I doing wrong here?

View Replies !   View Related
Scanning Directory Tree - Too Slow
I wrote a recursive algorythm to scan a comlete directory structure
(2-3 levels deep) with few hundred pictures in it (i just need to store
filenames in a cache file). it's taking forewer :(. i used readdir
function. Any idea to a faster solution?

View Replies !   View Related
Building A Category Tree For A Selection Box?
I'm trying to create a selection box in a form which displays all categories in a database, along with indents for sub categories. Code:

View Replies !   View Related
Creating A Website Tree From Database
I have been given the task of creating a website tree-type diagram. I have details about web pages stored in a MySQL database. There is a reference column in the database using the format:

1.0
1.1
1.1.1
2.0
2.0.1
2.0.2
2.0.2.1

I'm sure you get the gist. What I need to do is loop through these rows in the table, outputting them in their heirarchical structure, turning this into a graphical representation in HTML.

This has me confounded from the start. I'm not sure how I would loop through these numbers in the correct order. Also, I'm not sure how I would now when I've got to the next level of numbers e.g. after looping through 1.1 - 1.6 (which should all be in the same row), how I would know that I now need to create a new row for 1.1.1, and that on this row should also be 1.6.1 --- I'm confused just writing it out.

View Replies !   View Related
Directory Display -- In Tree Structure
how to do a tree structure display of a directory in PHP...If the user clicks the root directory it should display only the sub-directory and the files available in that diretory..whenever the user clicks the sub-directory it should show the directory and files available in that sub directory...

Thr tree structure display shoul be dynamic ,whenever the user add's the files it should be automaticaly dect the folder..i don't want to hard code the tree structure.

View Replies !   View Related
Recursive Directory Tree Function
I'm trying to make a function that recursively(?) makes a directory tree. So far I can't get it working and I'm really not sure what to do. Here's what I have so far: PHP Code:

View Replies !   View Related
Generic MySQL/PHP Tree Schema?
Folks, any url's around re subject matter? Performance isn't
necessarily a problem, and the depth will be under, say, twenty.

View Replies !   View Related
Creating A Tree And Storing It In MySQL
I'm wanting to create a tree structure and store this in a database, which can then be retrieved and displayed. I'm looking to implement this with PHP and MySQL. From what I gather it is possible using a table with two or three columns: ID, Parent_ID, Description.

So if we start from the top, the leaf would have an ID of 1, and a parent_id of 0. An item down the tree would have an ID of 2, and if a child of the first, a parent_id of 1, and so forth. How would I extract this from the database? Would I get all the data and then manipulate with PHP? Presumably I need to use some kind of recursion(another thing I'm a little shaky on).

View Replies !   View Related
List All Sub/Sub-Sub Etc.. Categories (Category Tree)
I'm trying to list category tree, but I'm having problems listing sub-sub.. categories. This is my Category field:

+-------+----------+------+-----+---------+----------------+
| Field | Type     | Null | Key | Default | Extra          |
+-------+----------+------+-----+---------+----------------+
| ID    | int(11)  | NO   | PRI | NULL    | auto_increment |
| NAME  | longtext | YES  |     | NULL    |                |
| P_ID  | int(11)  | YES  |     | NULL    |                |
+-------+----------+------+-----+---------+----------------+

This is my code So far: Code:

View Replies !   View Related
Directory / File Tree With Hyperlinks
I am trying to create a page that will list a directory/file tree and allow the user to click on the filename to download the file.

I have several directories with many files in each directory.  I would like the directory names listed with no hyperlink, but the filenames listed underneath the directory name and indented a bit with a hyperlink to the file location.

I did download a directory tree script from the web and it works fairly well, but I can not figure out how to get the hyperlink functionality working.

Can anyone help me with this?

View Replies !   View Related
Creating A Parent->child Tree
Does anyone know any good tutorials on creating a parent->child tree?

Ive looked through google but cant seem to find any?

View Replies !   View Related
Tree Traversal => Nested Array
'm exploring what DB-model for storing hierarchical data will suit my application best. As far as I can see there are two options: the adjency list model and the tree traversal model. The first one is pretty clear to me, and with it I'm able to get the entire tree or a portion of it into a nested array for further processing.

However, somehow the tree traversal method intrigues me and I want to see if it will fit my needs. So far my first major obstacle is to extract the data from the DB as a nested array, which I can pass on to my gui-class. My testing db looks like this now:

id|title|lft|rgt
1|root|1|10
2|item1|2|3
3|item2|4|9
4|item2.1|5|6
5|item2.2|7|8

Can anyone give me some pointers on how to process this?

View Replies !   View Related
How To Read LDAP Tree Structure?
I connect an ILS server. How to do to know the tree structure? I don't know how to use the ldap_search function ! (syntax of the DN).

View Replies !   View Related
Retrieve TREE Structure From Mysql Db
I already know how to print a tree structure using a recursive function but what i want is to save the results in a multidimensiona array so i will be able to format them in a table with graphic etc. the funciont that i am using to simple print the structure is:

function display_children($parent, $level) {
// retrieve all children of $parent

$result = mysql_query('SELECT titolobreve,id FROM categorie '.
'WHERE parent="'.$parent.'";');

// display each child
while ($row = mysql_fetch_array($result)) {
// indent and display the title of this child
echo str_repeat('- ',$level).$row['titolobreve']."
<br>";

display_children($row[id], $level+1);
}
}

View Replies !   View Related
Include Files Outside The Document Tree
I have an Apache - Mysql - PHP server. My PHP scripts have to connect to Mysql which means that they have a user name and password shown in them. At present, these scripts are inside the htdocs document tree.

I think that it would be better if I had a small script ouside the htdocs document tree that contained the user name and password for mysql and that did the logging in function.

Is this a correct assumption and if so, how do I do it. Is there a apache.conf or php.ini line that needs to be changed?

View Replies !   View Related
Windows-explorer-like Tree-folder Menu Where Available
Does anybody know where i can get an already-designed Windows-explorer-like tree-folder Menu, preferrably designed with PHP/HTML?

View Replies !   View Related
Files And Directories In Tree Structure Format
i need php code to display all my files and directories in a tree structured format.

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved