表中没有可用数据,但显示了数据库中的数据

阿玛特

数据表显示数据库的内容,但仍显示错误消息:表中没有可用数据。我该如何解决,只显示没有错误信息的数据

<table name= "displaycase" id="example1" class="table table-bordered table-striped" method = "post">
  <thead>
    <tr>
      <th>Case Title</th>
      <th>Court</th>
      <th>Dockent Number</th>
      <th>Nature</th>
      <th>Actions Taken</th>
      <th>Status</th>
      <th>Due Date </th>
    </tr>
  </thead>
  <tbody>
  <tbody class = "searchable">
    <?php
    if (mysql_num_rows($result) > 0) {
      // output data of each row
      while ($row = mysql_fetch_assoc($result)) {
        echo
        "</td><td>" . $row["CaseTitle"] .
        "</td><td>" . $row["Court"] .
        "</td><td>" . $row["docketNum"] .
        "</td><td>" . $row["nature"] .
        "</td><td>" . $row["actionsTaken"] .
        "</td> <td>" . $row["status"] .
        "</td> <td>" . $row["dueDate"] .
        "</td></tr>";
      }
    } else {
    }
    ?>
  </tbody>

--

<script>
        $( document ).ready(function() {
        $("#example1").DataTable({
            "paging": false,
            "ordering": true,
            "info": false,
            "language": {
                "emptyTable": "No Data"
            }
          })
    });</script>

在此处输入图片说明

娜娜·Partykar
  1. method = "post"<table>标签中删除
  2. 为什么<tbody>里面有两个标签<table>删除一个。
  3. 为什么</td>还没打开就关闭了。
  4. 没有<tr>打开。

更新代码:

<table name= "displaycase" id="example1" class="table table-bordered table-striped">
  <thead>
    <tr>
      <th>Case Title</th>
      <th>Court</th>
      <th>Dockent Number</th>
      <th>Nature</th>
      <th>Actions Taken</th>
      <th>Status</th>
      <th>Due Date </th>
    </tr>
  </thead>

  <tbody class = "searchable">
    <?php
    if (mysql_num_rows($result) > 0) {
      while ($row = mysql_fetch_assoc($result)) {
        echo
        "<tr>".
          "<td>" . $row["CaseTitle"] ."</td>".
          "<td>" . $row["Court"] ."</td>".
          "<td>" . $row["docketNum"] ."</td>".
          "<td>" . $row["nature"] ."</td>".
          "<td>" . $row["actionsTaken"] ."</td>".
          "<td>" . $row["status"] ."</td>".
          "<td>" . $row["dueDate"] ."</td>".
        "</tr>";
      }
    } else {

    }
    ?>
  </tbody>
</table>

[注意不建议使用mysql扩展,以后将删除:使用mysqli或PDO代替

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如果数据库表中没有值,如何在PHP中显示

“表中没有可用数据”VueJS

ListView显示数据库中没有任何项目

TCPDF没有显示MySQL数据库中的Unicode

Spring项目没有看到数据库中的表

数据表“表中没有可用数据”

如何显示数据库中的所有表名?

显示给定 MySQL 数据库中的所有表

在 jqGrid 中显示数据库表

PHP:在表中显示mysql数据库中的数据

在表中垂直显示数据库中的数据

在laravel刀片表中显示数据库中的数据

数据表显示使用Angular表中没有可用数据

从数据库中获取数据并显示到表

如何独立显示数据库表中的数据

如何从数据库中的表中获取所有数据并使用php显示呢?

无法在表中显示数据库中的所有数据

如何显示MySQL中的所有数据库以及foreach数据库显示所有表

是否有设置来停止在DataTable中显示“表中没有可用数据”?

数据没有从数据库中删除

如何在Android中显示没有数据库的脱机在线数据

var dump显示结果,但是没有在数据库中插入数据

大表数据库中没有数据关系?

Codeigniter 从数据库中的多个表中选择数据 | 没有加入

当其他表正在工作时,我的数据没有插入到数据库中

从没有与其相关的模型的数据库中获取表数据

MySQL / PHP检查数据是否在数据库表中,如果没有插入

显示数据库中的所有数据行

如果在数据库中没有可用的图像,则隐藏损坏的图像