how do i kno how many loops i need...
for example....
There is one table that has 6 fields one of which is Userid, another deptid and another is linemanid
so dan could be
userid=134
deptid=2
linemangerid=123
dan could have staff...
dave
userid=158
deptid=2
linemangerid=134
rob
userid=162
deptid=2
linemangerid=134
... rob could have staff
jon
userid=198
deptid=2
linemangerid=162
Andy
userid=205
deptid=2
linemangerid=162
Dan needs to see all these people, Rob can see jon and andy, and andy and jon can just see their own
so the start point would be
select * from table where linemanagerid=session("userid")
so.. for dan this would return dave and rob. so i now need to work out how dan can see jon and andy through rob.. and if jon and andy were line managers thier people, so the loop could be very long of very short...
does that make any more sense?