mysqli_num_rows() - php文件

时间:2017-07-13 14:36:39

标签: php

我有一个名为prediction_get.php的PHP文件,代码如下:

<?php

include('connect_MyDB.php');

$sql = "SELECT * FROM tabel WHERE tabel_game='new' ORDER BY tabel_id ASC LIMIT 10";
$result = mysqli_query($conn, $sql);    

if (mysqli_num_rows($result) > 0) {
     // output data of each row
     while($rows = mysqli_fetch_assoc($result)) { ?>
      <tr>
        <td><?php echo $rows['tabel_competitie']; ?></td>
        <td><?php echo $rows['tabel_data']; ?></td>
        <td><?php echo $rows['tabel_ora']; ?> CET</td>
        <td><strong><?php echo $rows['tabel_home_team']; ?> - <?php echo $rows['tabel_away_team']; ?></strong></td>
        <td><?php echo $rows['tabel_predictie']; ?></td>
      </tr>
      <?php
      }
}
// close connection
mysqli_close($conn); 
?>

我在第8行收到以下错误:

PHP警告:mysqli_num_rows()要求参数1为mysqli_result,布尔值在第8行的/home/c0242390/public_html/abcdefg.com/prediction_get.php中给出

有人可以帮我解决问题吗?

0 个答案:

没有答案