select question about user permission and the "boss&quo

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

select question about user permission and the "boss&quo

Post by pelegk2 »

i have user with certain pemission:
user name,user owner,user permission list= 1,4,7,33

and i have a "boss" for every few user's that have the user's permmision and more!

now i make a selec like this :

Code: Select all

SELECT * from myDb where user_owner='".$_SESSIONї'auth']ї'user_name']."'"
and i want when the "boss" enters that he will see all the row's of him self and his workers that ar relavent to both of them!
(beacuse myyabe the worker work;s for another department too,to which his boss dont have access to!)
how do i do that?
thanks i nadvance
peleg
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Ok, this one hurts my brain when i read it ;)
It sounds like you database design is making life difficult, might be worth trying to come up with a more logical design that makes these queries much easier. Unless someone else can decipher the problem and come up with an answer ;)
Post Reply