I`ve attached the db table users.
What I need to do is this:
admins job is to be able to create dealers,superusers and admins.
If he creates superusers and admins, the groupid is suffecient, and works as it should.
if he creates a dealer
on insert the about to be created userID should be inserted into FH_id (Thats the part I dont know how to do)
That way we can always make querys against dealers...
On seperate Insert,update,results,search pages for dealers I need to do this:
Dealer can only create sales persons.
On insert of a new dealer the about to be created userID should be inserted into SA_id (Thats the part I dont know how to do)
On the same insert, since its a dealer, and he is logged in, I need to insert the usersession from the dealer into the about to be created salespersons FH_id. (Thats the part I dont know how to do)
I made a user exampel in the db, so you can see what I mean..
Dealer with id3 has created salesperson(id4), so when he does that, the row for salesperson should have dealers id into the FH_id and salespersons own id into the SA_id.
This way we can easily create quaries against dealers and there attached salespersons...
Also could you explain how to make a trigger that would on conditions trigger the different insert server behaviours...