【问题标题】:Selecting all record in mysqli选择mysqli中的所有记录
【发布时间】:2015-04-01 16:24:12
【问题描述】:

我想选择mysqli中的所有记录,我使用如下语法

$stmt->get_result();

但我得到的是单个数据,我想选择所有数据,然后对数据应用 while 循环。

提前致谢

【问题讨论】:

    标签: select mysqli


    【解决方案1】:

    将其包装在一个while循环中:

    $stmt->get_result();
    while ($row = $result->fetch_array(MYSQLI_NUM)) {
      $rs[]=$row;
      //Or just process it here.
    }
    

    或使用http://php.net/manual/en/mysqli-result.fetch-all.php

    【讨论】:

      猜你喜欢
      • 2015-12-02
      • 2021-01-01
      • 2013-11-24
      • 2013-04-17
      • 2023-02-22
      • 2013-01-07
      • 1970-01-01
      • 1970-01-01
      • 2012-02-24
      相关资源
      最近更新 更多