Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT GROUP_CONCAT(lv SEPARATOR ',') AS 'Reports' FROM (
- SELECT @pv:=(SELECT GROUP_CONCAT(JobInfo.EmpID SEPARATOR ',') FROM JobInfo WHERE ReportsToEmpID IN (@pv)) AS lv FROM JobInfo
- JOIN
- (SELECT @pv:=$empID)tmp
- WHERE ReportsToEmpID IN (@pv)) a;
- [2] => array( <---- this is you
- [5] => array( <---- this is a person directly beneath you
- [0] => 263
- [1] => 152 <----- these are people below the person directly beneath you,
- [2] => 33 it doesn't matter how far down they are.
- [166] => array( <----- this is another person directly beneath you
- [0] => 243
- ),
- [199] => array( <----- this is another person directly beneath you
- [0] => 43
- [1] => 44
- [2] => 45 <----- these are people below the person directly beneath you,
- [3] => 46 it doesn't matter how far down they are.
- [4] => 47
- [5] => 48
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement