This topic is locked

Stored Procedure

12/4/2020 3:27:20 AM
PHPRunner General questions
K
klawi author

Hi there and greetings,

I hope someone from the community can help me with my Problem: I want to update a field (verweildauer) in my database (mysql) in all records at startup of PHPRunner.

At the moment I created a Stored Procedure like this:



(Name of Stored Procedure = berechnen_verweildauer)


BEGIN

UPDATE tiere

SET Verweildauer = Datediff(CURDATE(),ErfDatum)+1;

END
This works just fine in phpmyadmin. Now I have two questions.
I tried to use the stored procedure in PHPRUNNER like this:

DB::Exec("CALL berechnen_verweildauer");

It does not work this way.
Is there something I did wrong? Even it it would work, what is the best place to

use it on startup of the application so it will work and update all records?
Thanks for your time. Hoping someone out there can help me.

Werner

Sergey Kornilov admin 12/4/2020

What event do you add this code to? As a first step you need to make sure that this code is actually executed i.e. you can output something to the web page after this stored procedure call and it will help you understand what is happening.

K
klawi author 12/5/2020



What event do you add this code to? As a first step you need to make sure that this code is actually executed i.e. you can output something to the web page after this stored procedure call and it will help you understand what is happening.