开发者

Beginners' guide to stored procedures with MySQL?

开发者 https://www.devze.com 2023-01-26 18:17 出处:网络
I\'ve Googled but come up with nothing that I can get my head around. Are the performance gains from using stored procedures significant?

I've Googled but come up with nothing that I can get my head around.

Are the performance gains from using stored procedures significant?

Would I still want to use prepared statements in conjunction with stored procs or is it generally a one or the other thing?

Can I create stored procs through PHPMyAdmin and 开发者_如何学编程manage them from there as well?

What would a stored procedure look like for something simple like this-

SELECT * FROM table a 
INNER JOIN otherTable b 
ON a.join_id=b.join_id 
WHERE someVar = :boundParam

and how would the PHP work (PDO) to call it and bind its parameter?


Consider this a gentle introduction to stored procedures in MySQL: http://www.mysqltutorial.org/mysql-stored-procedure-tutorial.aspx

You sure can create/manage stored procedures in phpMyAdmin.


I have created one procedure but the time of call this procedure what parameter I can pass to get the output

CREATE DEFINER=`root`@`localhost` PROCEDURE `A`(

In user_id bigint,
Out address varchar(250)

)
BEGIN

select Address into address
from UserDetail_table
where User_ID = user_id; 

END
0

精彩评论

暂无评论...
验证码 换一张
取 消