Database Systems - PHP Database Programming with Stored Procedure Calls for Web - APPFICIAL

preview_player
Показать описание
Stored procedure calls

A PHP script is able to call a stored procedures from database by using a prepared statement. The values are bound to the stored procedure's IN parameters. Stored procedures that have either OUT or INOUT parameter required a call with an SQL user-defined variable. To fetch the value of the variable and get the output parameter value, another query is required.

The code explained:

RMovieCount counts the number of R rated movies in the database Movie table
The prepared statement uses a CALL statement to call count with the rating “R".
execute() calls count. The OUT parameter quantity is assigned to the @count variable.
A second query fetches the value of @count.

Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!
Рекомендации по теме
welcome to shbcf.ru