Well on a side note this is my first post, but seems like an excellent community. Now onto business...
I've looked around at several approaches, but basically I have a table of employees, and one column stores a supervisor ID. For example:
I am working on an application for mangers to login and view employee information. I could easily get it working for a manger to view employees directly beneath, but I would like managers to view ALL employees under him. For example, John Smith should see those records of people who directly report to him, but also those that report to people who directly report to him. In this example, John Smith should have access to ALL records. I am using PHP and MySQL, and just can not grasp the SQL queries behind this one. I can imagine using recursion somehow, but i'm fairly new to this.
Managing hierarchical data in MySQL
(There's a fair bit to consume there, but it does a good job of explaining the 2 main options and their pros and cons.)
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)