How does php call stored procedures with returned results?

Source: Internet
Author: User
This is a problem that has not been solved by the returnee who used the CI framework to call the stored procedure. after reading the technical documentation, I can extract it because the project has been in use for a long time.

This is a problem that has not been solved when a returnee has an error in calling the stored procedure using the CI framework. after reading the technical documentation, I can extract it because the project has been in use for a long time, now there is no time for testing. for example, you can leave a message when you encounter problems...

MySQL extension also supports stored procedures, but only supports stored procedures with no returned results. if the stored procedure has an output, this call will throw an error. the specific error is missing. The call method is simple:
$ Rs = mysql_query ("call func ('str')", $ conn );
If a returned result is returned, for example, a string, an error is returned. the solution I have found is to use the MySQLi extension:
$ Rs = mysqli_query ("call func ('str')", $ conn );
In this way, $ rs is used as a normal MySQL Result, which is very convenient.


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.