【问题标题】:mysqli method calling ordermysqli方法调用顺序
【发布时间】:2011-08-23 10:55:35
【问题描述】:

我从 php 手册中知道 bind_result 必须在 execute 之后和调用 fetch 之前。

我想知道正确的订单在哪里或在哪里放置 store_result 目前我正在调用 pria 到 bind_results。

$psl -> execute();
$psl -> store_result(); // ?
$psl -> bind_result($val);
$psl -> fetch();

谢谢

【问题讨论】:

    标签: php mysqli


    【解决方案1】:

    如果您希望检索查询返回的行数,则必须在调用execute() 之后调用store_result()。有关更多信息,请参阅此内容:

    http://www.php.net/manual/en/mysqli-stmt.num-rows.php

    为了澄清,我总是在拨打execute() 之后拨打store_result()。我不确定您是否可以在绑定结果后调用它,但也许其他人能够澄清这一点。

    【讨论】:

    • 我在 bind_result 方法之后调用了 store_result 并且它仍然有效,php-error 日志中没有错误通知。就像你说的 Pete171 等着看有更多的澄清方法调用命令。
    猜你喜欢
    • 2014-07-27
    • 1970-01-01
    • 1970-01-01
    • 2014-03-21
    • 2012-03-15
    • 1970-01-01
    • 1970-01-01
    • 2021-12-26
    • 2015-12-30
    相关资源
    最近更新 更多