I am making a 3 member mlm script. The design of my database is following:
CREATE TABLE IF NOT EXISTS `members` ( `memb_id` mediumint(9) NOT NULL AUTO_INCREMENT, `memb_pid` mediumint(9) NOT NULL, `memb_pos` tinyint(1) NOT NULL, `memb_fullname` varchar(50) NOT NULL, PRIMARY KEY (`memb_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
Now as per the design its simple enough and i with just memb_pid can add as many members by using the memb_pos (position left, mid or right).
As 1 member can only have 3 sub-members that i have also covered. The issue i am facing is that this has to be only 9 levels deep.
How do i find out if its 9 level deep or not ?