473,799 Members | 3,084 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP implementations of algorithms for storing heirarchical data in a relational DB

There's lots of ways of representing a hierarchical data structure in a
relational database. These range from the trivially easy to implement in
PHP (adjacency list; each node has an ID and a ParentID) to the fairly
nightmarish (Tropashko's nested intervals).

In starting this thread I'm not looking for a primer on any of these
methods, which Google will happily provide; I'm looking to create a list of
PHP implementations of any such method - and in particular I'm hoping that
someone's tackled Tropashko's stuff in PHP already so that I don't have to
reinvent the wheel ;-)

So please post if you've developed, or know of, any PHP implementation for
handling this kind of data, maybe using the methods I've mentioned, some
Celko-inspired method, or maybe something totally different.

Maybe someone else is already working on Tropashko's newest article, posted
on comp.databases. theory only yesterday, http://arxiv.org/html/cs.DB/0401014
?

Cheers

Matt Saunders.
Jul 17 '05 #1
3 3088
Hello,

On 01/21/2004 07:53 AM, Matt Saunders wrote:
There's lots of ways of representing a hierarchical data structure in a
relational database. These range from the trivially easy to implement in
PHP (adjacency list; each node has an ID and a ParentID) to the fairly
nightmarish (Tropashko's nested intervals).

In starting this thread I'm not looking for a primer on any of these
methods, which Google will happily provide; I'm looking to create a list of
PHP implementations of any such method - and in particular I'm hoping that
someone's tackled Tropashko's stuff in PHP already so that I don't have to
reinvent the wheel ;-)

So please post if you've developed, or know of, any PHP implementation for
handling this kind of data, maybe using the methods I've mentioned, some
Celko-inspired method, or maybe something totally different.

Maybe someone else is already working on Tropashko's newest article, posted
on comp.databases. theory only yesterday, http://arxiv.org/html/cs.DB/0401014
?

You may want to learn Joe Celko's approach to solve that problem
efficiently with SQL databases. His approach is described in this book:

Title: SQL for Smarties: Advanced SQL Programming
http://www.phpclasses.org/products.h...558605762.html
You may want to take a look also at these PHP implementations of trees
in databases:

Class: Joe Celko Nested Sets
http://www.phpclasses.org/celkonestedset

Class: myXTree
http://www.phpclasses.org/myxtree

Class: php_tree
http://www.phpclasses.org/raro_php_tree
--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 17 '05 #2
Manuel Lemos wrote:
You may want to learn Joe Celko's approach to solve that problem
efficiently with SQL databases. His approach is described in this book:


The OP specifically mentioned Celko in his post, so I think he was aware
of his approach and his book.

Jochen
Jul 17 '05 #3
"Jochen Buennagel" <za*********@bu ennagel.com> wrote in message
news:bu******** *****@news.t-online.com...
Manuel Lemos wrote:
You may want to learn Joe Celko's approach to solve that problem
efficiently with SQL databases. His approach is described in this book:


The OP specifically mentioned Celko in his post, so I think he was aware
of his approach and his book.

Jochen


Correct, I was aware of Celko's approach, but (for a comprehensive review of
the topic I'm writing) I wanted to pick people's brains here for their
knowledge of any specificly PHP implementations of it or similar
algorithms - which is exactly what Manuel supplied, so thanks very much.
Anyone else have any?

Cheers

Matt S.
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
11520
by: Rolf Hemmerling | last post by:
Hello ! Beginner's question: What ist the easiest way to store and save objects in a file generated by a C++ program, by using the "standard C++ library" and/or "Standard Template Library ( STL )" ? So I would like to generate some objects ( of different classes ) with a C++ program and would like to make it permanent / persistent, so that
2
1570
by: Tom | last post by:
Hi, I'm designing a website where all the articles/news will be stored in XML. (I will use PHP to parse the XML.) Should I store the XML in separate .xml files or should I store the XML in a MySQL database? Which would be faster? Best regards, Tom
1
1140
by: Dr Ann Huxtable | last post by:
Hello, I am trying to design an abstract data type (lets call it an HTable) which mimics a heirarchical rcordset (ala ADO 2.0). I have got this far: 1). Data will be stored in a vector of vectors 2). The HTable Constructor will specify the datatypes for the columns - and this cannot be changed later - ensuring all row columns are of the same data types 3). Create a Row object that returns a vector "horizontal" slice at the
3
2250
by: Ann Huxtable | last post by:
Hi, I am writing a nested table structure to mimic data returned from a database (actually, a heirarchical recordset). I am representing the cells where the actual data is stored, by a union: class Cell { union { char* s ; //std::string s ;
6
1313
by: cleveralex1212 | last post by:
Sorry to disturb. I'm truly a beginner in C++ and my knowledge of it is really not much. I've been facing a serious problem during these few days. Let me describe my situation as clearly as I can and I do hope you guys can give me a helping hand. Suppose I have a number of people's personal information such as name, age, hobbies, etc. How can I store them in a way that can be easily amended by each person? How can I group the people with...
1
1895
by: Lucas Fletcher | last post by:
Hi All, I've searched the web for an article explaining the many tradeoffs between storing your XML in a database vs the filesystem but I haven't really found anything of note. This is the little I've come up with: FileSystem Pros:
6
2505
by: Mudcat | last post by:
Hi, I am trying to build a tool that analyzes stock data. Therefore I am going to download and store quite a vast amount of it. Just for a general number - assuming there are about 7000 listed stocks on the two major markets plus some extras, 255 tradying days a year for 20 years, that is about 36 million entries. Obviously a database is a logical choice for that. However I've never used one, nor do I know what benefits I would get...
3
1421
by: redefined.horizons | last post by:
I'm just beginning to learn C programming, after working for a while with high-level languages. I am wondering if there is a standard set of implementations for things like hash maps and linked lists that can be used by C programmers. I took a look at the GNU C Library, but I saw functions, not data structures. Do C programmers come up with their own data structures, or is there a standard set that I can use? Thanks for the help. ...
10
3061
by: nayden | last post by:
I started playing with python a few weeks ago after a number of years of perl programming and I can say that my first impression is, unsurprisingly, quite positive. ;) The reason I am writing here is that I can't seem to figure out how to save/restore python objects into a relational database. The way I used to do it in perl was to 'freeze' the object before storing it into the database and 'thaw' it before restoring it. (For those not...
0
10473
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10219
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10025
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7563
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6804
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5461
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5584
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.