Home  >  Article  >  Backend Development  >  请问如何获取mysql存储过程的out参数的值

请问如何获取mysql存储过程的out参数的值

WBOY
WBOYOriginal
2016-06-13 12:43:341140browse

请教怎么获取mysql存储过程的out参数的值
我查到这样获取:

 mysql_query("call P__Test_Login(@Message, @Id, '{$userId}', '{$pwd}')", $conn) or die("Query failed:".mysql_error());  
    $result_mess = mysql_query("select @Message");  
    $result_uid = mysql_query("select @Id");  
    $row_mess = mysql_fetch_row($result_mess);  
    $row_uid = mysql_fetch_row($result_uid);  
    $Proc_Error = $row_mess[0];  
    $uId = $row_uid[0];  

但这样子下面执行存储过程之后又连续使用了
    $result_mess = mysql_query("select @Message");  
    $result_uid = mysql_query("select @Id");  

这样等于是不是又向数据库连续发了两次请求,这样压力也太大了额。
我想发一次请求,把输出参数就获取到,就没办法吗?

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