Using stored procedure in a hook
Posted: 2023-02-27 14:36
Hello,
I created a stored procedure in MariaDB, which works well. Now I wanted to use it in the table_after_insert() hook. I could imagine to do it like this:
$db->query('call insertMaintenance('.$data['ResourceId'].', '.$data['EndDate'].');');
But where does this $db object comes from? Do I have to create a new one or is there still one available from the previous insert operation?
Thank you for pointing me to the right direction.
Olaf
I created a stored procedure in MariaDB, which works well. Now I wanted to use it in the table_after_insert() hook. I could imagine to do it like this:
$db->query('call insertMaintenance('.$data['ResourceId'].', '.$data['EndDate'].');');
But where does this $db object comes from? Do I have to create a new one or is there still one available from the previous insert operation?
Thank you for pointing me to the right direction.
Olaf