【问题标题】:stmt->get_result() doesn't completestmt->get_result() 未完成
【发布时间】:2016-03-29 16:01:12
【问题描述】:

我有一个带有 echo 的 php 代码来检查它在哪里停止(它不会崩溃,但会停止发送 echo 并且不能按预期工作)

$stmt=$conexion->prepare("SELECT Email, MaxActiv FROM `Keys` WHERE ProdKey = ?");
$stmt->bind_param('sss', $varKey);
$stmt->execute();
echo "before";
$stmt->store_result();
echo "middle";
$resultado = $stmt->get_result();
echo "later";
$row = $resultado->fetch_assoc();
echo "then";
$aa = $row["Email"];

它在 echo "later" 之前停止;所以它必须在get_result();上失败

【问题讨论】:

标签: php mysql mysqli prepared-statement


【解决方案1】:

有两种可能的原因:

  1. 没有为您的系统安装 Mysqlnd,这使得 get_result() 不可用。你必须安装 php-mysqlnd。
  2. 您不能同时使用 get_result() 和 store_result()。从代码中取出 store_result 调用。

【讨论】:

    猜你喜欢
    • 2018-06-25
    • 1970-01-01
    • 2013-11-01
    • 2015-02-21
    • 1970-01-01
    • 1970-01-01
    • 2022-01-11
    相关资源
    最近更新 更多