Home >Database >Mysql Tutorial >How Can I Create and Call Stored Procedures Using phpMyAdmin and PHP?
Managing and Utilizing Stored Procedures in phpMyAdmin and PHP
Creating and managing stored procedures through phpMyAdmin is possible, despite misconceptions. To create a stored procedure in phpMyAdmin, navigate to the SQL tab and follow these steps:
Upon creation, the stored procedure will appear under the "Routines" section in the "Structure" tab.
To utilize the stored procedure in PHP, execute a CALL query:
<?php // Connect to MySQL $conn = mysqli_connect("host", "user", "password", "database"); // Call stored procedure $result = mysqli_query($conn, "CALL sp_test()"); // Process results while ($row = mysqli_fetch_array($result)) { echo $row[0]; // Display column value } // Close connection mysqli_close($conn); ?>
The above is the detailed content of How Can I Create and Call Stored Procedures Using phpMyAdmin and PHP?. For more information, please follow other related articles on the PHP Chinese website!