hello in event Before record added , I would like to do an sql request but I dont know what to do..
I have a user table. Each user is part of a group and One user on each group as the "admin field " to Y.
I want when I record a new entry , when I pick the user name from a lookup table that in the Field admin user the correct admin of this user that is part of the same group shows up autopmaticly.
example : user jack is member of marketing team . User Ted is member of marketing too with admin right. I want when I choose Jack on lookup, that the next field ( Admin name of this user) to be filled with the name of Ted.
So I can get the ID user with echo $values["iduser"]; ( to get JAck id) but then I dont know how to get the userid of Ted .. In fact I need to do a $sql with select user.* where group = "$value from the user ted " and Admin = Y ..
if you have any idea..
thank you.