News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Daniel Cousineau's Blog:
Hierarchical Data With PHP and MySQL
June 02, 2008 @ 12:09:37

Daniel Cousineau submitted a new blog post he's come up with that looks at using hierarchical data in a MySQL database.

I recently had fun with an all-to-common issue with SQL driven websites: hierarchical data. For those who don't like big words, think trees. Other people have already discussed storage methods, and I would actually highly suggest you read the writeup if you haven't already.

He includes a sample table you can work from and some code that can be used to generate a select (based on a $depth variable) parent/child values from it. A few simple function calls later and you have a nested array or lots of little subarrays maintaining the parent/child relationships the database has.

0 comments voice your opinion now!
hierarchical data mysql tutorial database depth


blog comments powered by Disqus

Similar Posts

HowTo Forge: Installing Lighttpd With PHP5 And MySQL Support On Fedora 7

NETTUTS.com: Real-World OOP With PHP and MySQL

Insidesigns Blog: Create a scalable private messaging application using PHP5

BillS' IIS Blog: How to install PHP on IIS7 (RC1)

PHPMaster.com: Getting Started with Fuel CMS, Part 1


Community Events

Don't see your event here?
Let us know!


php7 extension voicesoftheelephpant laravel5 api example podcast introduction opinion interview framework unittest community laravel library language version release conference series

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework