-1

ねえ、これは私がデータベースに一致するものを見つけることができないか、何かを見つけることができる場合、それは前に出て何かを言うべきであるように私が作ったに違いない方法ですが、私はそれを構築する方法について完全に解決しています。私はについて聞くでしょう私を助けることができます

私はこれをやろうとします:

<?php
if ($stmt = $mysqli->prepare('SELECT id_forum, title, tekst, dato, id_brugere FROM `forum` ORDER BY `forum`.`id` DESC'))
{
   $stmt->execute();
   $stmt->bind_result($id, $djnavn, $profilbillede);
   $rows = $stmt->num_rows;
   echo $rows;

   while ($stmt->fetch())
   {
   ?>
      <td class="titleforum"></td>
      <td>Dato:</td>
   <?php
   }
   $stmt->close();
}
else
   $row_cnt = $result->num_rows;
   print_r($row_cnt);
?>

しかし、それは何も話したり、見えたりすることはまったくありません..私がこれから欲しいのは、それが何かを言っているということですか?

4

1 に答える 1

0

試す:

<?php
if ($stmt = $mysqli -> prepare('SELECT id_forum, title, tekst, dato, id_brugere FROM `forum` ORDER BY `forum`.`id` DESC'))
{
   $stmt -> execute();
   $stmt -> store_result();

   $rows = $stmt -> num_rows;
   echo $rows;

   while ($stmt -> fetch()) {
?>
      <td class="titleforum"></td>
      <td>Dato:</td>
   <?php
   }
   $stmt->close();
}
?>

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

于 2012-05-28T19:07:20.807 に答える