Php and mysql are a natural pair. next I will introduce how to call the mysql stored procedure and execute the returned results in php. below I will summarize some common php methods for calling the MySQL stored procedure, for more information, see.
MySQL from the beginning of 5.0 to introduce the stored procedures, anyway, never touched before, but now because the main internal system, so many applications are used to the stored procedures, of course, the front sometimes need to call the MySQL
Php stored procedure calls the instance code. Copy the code as follows: for example, the stored procedure to be called is gxtj (a, B) $ dbnewmysqli (localhost, ssss, aaaaa, bbbb); mysqli_query ($ db, SETNAMESutf8 ); $ result $ db-query (ca
The code
Php stored procedure call example for your reference
The code is as follows:
// For example, the stored procedure to be called is gxtj (a, B)$ Db = new mysqli ("localhost", "ssss", "aaaaa", "bbbb ");Mysqli_query ($ db, "set names utf8 ");$ Result
This article will introduce some of my learning notes during the mysql Stored Procedure (create, delete, and call). If you need to learn the stored procedure, you can go to the reference page.
1. Create a stored procedure1. Basic Syntax:Create
Explain how php calls the MySQL stored procedure method. Php and mysql are a natural pair. next I will introduce how to call the mysql stored procedure and execute the returned results in php. below I will summarize some common php methods for
PHP call MySQL stored procedure instance analysis, MySQL instance analysis
This paper analyzes the method of PHP calling MySQL stored procedure. Share to everyone for your reference. The specific analysis is as follows:
MySQL stored procedure
Copy codeThe Code is as follows:// For example, the stored procedure to be called is gxtj (a, B)$ Db = new mysqli ("localhost", "ssss", "aaaaa", "bbbb ");Mysqli_query ($ db, "set names utf8 ");$ Result = $ db-> query ("call gxtj ($ year, $ jd)"); //
PHP and MySQL are inherently a pair, let me explain how to call in the PHP program in MySQL has been written in the stored procedures, we look at the implementation of the specific method.
MySQL Stored procedure creation syntax
The code
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.