php mysqli编写语句存储过程OUT参数

时间:2013-03-06 22:10:19

标签: php stored-procedures parameters mysqli prepared-statement

我有一个涉及在mysqli预处理语句中使用存储过程的问题。 我将展示的代码片段确实有用,我只想知道原因。 准备好的语句调用一个存储过程,它接受6个参数,其中第6个是OUT参数。

    if (!($stmt = $this->sql->prepare("CALL registerUser(?,?,?,?,?,?);"))) { ... }
    $stmt->bind_param("issisi", $id, $email, $pwd, $ip, $actKey, $notUsed);
    $stmt->execute();
    $stmt->bind_result($isSuccessful);
    $stmt->fetch();
    $stmt->close();
    $this->sql->close();

OUT参数绑定到

$notUsed

执行后不会产生任何值,但

$isSuccessful

我绑定到结果,确实从过程返回OUT参数,这个返回值可以是0或1,我已经多次确认了。 我只是不明白为什么会这样,因为程序不会产生任何结果。

0 个答案:

没有答案
相关问题