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

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

WBOY
Release: 2016-06-13 13:45:45
Original
1578 people have browsed it

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)

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template