Hi,
I'm trying to find an elegant solution to the following problem:
I' using phprunner 6.1 and a MySQL database and I am trying to build an interface to the database, security mode is 'Database' and 'Dynamic'.
In the database there are several tables like
'company'
'employee'
'application_user'
Table 'employee':
id_employee
first_name
last_name
Table 'application_user' (where the user_id, and password for the interface are stored):
id_user
user_login
user_password
user_full_name
employee_id (foreign key to the 'employee' table).
Table 'company'
id_company
created_by (foreign key to the 'employee' table)
updated_by (foreign key to the 'employee' table)
company_name
comment
What I would like to do: every time a new company id created, the application
1_Retrieve the id_of the logged in user.
2_Find the employee_id of this logged in user.
3_Automatically update the value 'created_by' with the 'employee_id' of the logged in user every time a new company is added.
4_Automatically update the value 'updated_by' with the 'employee_id' of the logged in user every time a company is updated.
Any bright idea on how best this could be done?
Thanks
Franck