php怎么调用带out参数的存储过程
时间:2021-07-01 10:21:17
帮助过:21人阅读
php如何调用带out参数的存储过程?
如
存储过程:
CREATE check_user(vUserName VARCHAR(20),vUserPWD VARCHAR(40),out vUserCount int )
begin
select COUNT(*) into vUserCount from user where user_name=vUserName and user_passward=vUserPWD;
end;
在php文件中怎么调用?
------解决方案--------------------
CREATE check_user(vUserName VARCHAR(20),vUserPWD VARCHAR(40),out vUserCount int )
begin
select COUNT(*) into vUserCount from user where user_name=vUserName and user_passward=vUserPWD;
end;
送出查询( "CALL check_user( 'user ', 'pass ',@vUserCount) ");
送出查询( "SELECT @vUserCount ");
$row = .....-> fetch_array();
print_r($row)