Home  >  Article  >  Backend Development  >  php怎么调用带out参数的存储过程

php怎么调用带out参数的存储过程

WBOY
WBOYOriginal
2016-06-13 13:45:451564browse

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)

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn