It's been a whole afternoon, and I haven't been able to fix it. Write events in PHP.
Because of business requirements, it is necessary to implement a pre-operational function, that is, a business person fills in a future to do an operation. Before this date arrives, everything will be as usual.
To write MySQL Event via PHP, it automatically executes when time is up.
But several deadly problems have been encountered.
The first is multi-statement execution.
If the query statement in PHP with a; number, then MySQL directly as a query end identifier, query after the statement is no matter, directly reported SQL40006 error.
Finding a solution that mentions a problem with delimeter can be done by specifying additional delimeter to avoid MySQL, which is considered an end-of-identity.
But Delimeter is the CLI function of MySQL, and the interface passed through PHP is not recognized at all. MySQL continues to error, do not know delimeter.
Check the StackOverflow, anyway saw said not can, did not say how to circumvent this problem to achieve demand.
Think about it, ready to take multiple operations apart to execute and create multiple new event. The operation is much more, the event also is many. But then there is a problem, what is the order of execution between the event?
If an event execution is unsuccessful, what happens to the next dependent event?
Feeling is a big bug, this need may not be realized.
[mysql+php] triggers and stored procedures such as MySQL function in PHP implemented in the pit