I am coding a php-angularjs webapp and I am now creating a revision system with procedure and triggers on insert/update.
after the login I need to do:
$sql = 'SET @id_user := ' . (int)$_SESSION['user']['id_user'].';';
it works well if I select it (returns the user id as expected) but later on (1 min later) after a few queries and pages visited, when I update the customer table everything is good except the @user_id var which is null
Question: Is there a way I can set the var for my full session to avoid repeating the SET @var every time I need to log the modifications?
(it also needs to think that I have multiple admins)