How do handle this? A system that allow people to register and introduce others to register too. The entry level is 1, For instance, if u introduce Mr. A, ur level increase by 1, if mr A introduce B, ur level increase by 1, Mr. A's level increase by 1 bt d problem now is hw to increment d level of d other referrer. say D was introduced by C who ws introduced by B who was introduced by A. So the level of A, B, C has to increment by 1. which means by d time D is registered , A level=4, B level=3, C level=2
You might want to look into doing this as a binary tree; You will need to apply some logic on the tree depth as the person at the top will be depth 0 (and wont actually increment). However, people that are referred will be added to a new level below the person that referred them so you can simply count the maximum depth below that person to get their level - simples. This will automatically grow to any size, so you might also want to consider if you need to use a maximum leve lnumber. (It is also the more efficient way to store relationships such as this) More infotmation on trees here; http://www.simple-talk.com/sql/t-sql-programming/binary-trees-in-sql/