Sounds like that darn Hierarchial Data again. Give this a read and see if it helps you out at all. In particular, you may find the area 'Finding the Depth of the Nodes' helpful. http://dev.mysql.com/tech-resources/articles/hierarchical-data.html Hope it helps, -K.Bear -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php