[mysql+php] triggers and stored procedures such as MySQL function in PHP implemented in the pit

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.