5

Hi I need to use the nested set model to mange product categories on my site. Does anyoune know of some good pre-built PHP libraries for handling nested sets in MySQL?

andrew
  • 5,096
  • 10
  • 43
  • 57

3 Answers3

4

You could try "Baobab", it's a library I recently released.

http://www.sideralis.org/baobab/

Riccardo Galli
  • 12,419
  • 6
  • 64
  • 62
  • Brilliant, I will check it out. I knew it was only a matter of time before someone with more skill than me would come out with a good object to manipulate nested sets. I will check it out and see how it goes. Thanks – andrew Jan 30 '11 at 07:26
  • Damn, where was this link yesterday? Awesome! The forum on your site is pretty thoroughly spammed though. – mattalxndr Jun 09 '11 at 05:24
  • This library will only work if you use a standard mysqli connection. PDO is not supported. – RonnyKnoxville Jul 28 '16 at 09:54
2

It's a bit old, and could do with some refactoring, but I found a PHP Class "dbtree" on PHPClasses.org, which seems to do a fair job of it - http://www.phpclasses.org/package/2547-PHP-Manipulate-database-records-in-hierarchical-trees.html

Luke Stevenson
  • 10,357
  • 2
  • 26
  • 41
0

You could use a PHP ORM solution like Propel or Doctrine, they both support nested sets.

wimvds
  • 12,790
  • 2
  • 41
  • 42
  • Doctrine page moved to here; https://www.doctrine-project.org/projects/doctrine1/en/latest/manual/hierarchical-data.html – Marek J. May 05 '22 at 13:53