【问题标题】:DataTables warning: Requested unknown parameter '2' from the data source for row '0'DataTables 警告:从数据源请求未知参数 '2' 用于行 '0'
【发布时间】:2016-09-02 11:46:59
【问题描述】:

嗨,任何人都可以帮助我,我正在使用数据表进行分页,我正在警告: DataTables 警告:从数据源请求未知参数 '0' 用于行 '0'

这是我的代码:

<?php 

include "admin/config.php";

$table="t_bad_order_report";
$select=$cfg->select("$table ORDER BY orderid DESC","");


?>

<html>
<head>
    <title></title>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="stylesheet" href="assets/css/bootstrap/bootstrap.css" /> 


  <link rel="stylesheet" href="assets/css/plugins/datatables/jquery.dataTables.css" />


    <!-- Data Table -->
    <!-- JQuery v1.9.1 -->
    <script src="assets/js/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>

    <!-- Bootstrap -->
    <script src="assets/js/bootstrap/bootstrap.min.js"></script>
    <script src="assets/js/plugins/datatables/jquery.dataTables.js"></script>
    <script src="assets/js/plugins/datatables/DT_bootstrap.js"></script>
    <script src="assets/js/plugins/datatables/jquery.dataTables-conf.js"></script>


        <link rel="stylesheet" href="assets/css/plugins/datatables/jquery.dataTables.css" />



</head>
<body>
    <div class="container-fluid">

          </div>
           <div class="col-sm-10" id="loginas" style="background-color:white"; class="table-responsive">
             <h1>Welcome Admin</h1>


            </div>
              <div class="col-sm-10" id="badorder" style="background-color:white;" class="table-responsive">



                        <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="basic-datatable">
                            <thead>
                                <tr>
                                    <th></th>
                                    <th>Name</th>


                                </tr>
                            </thead>
                            <tbody>
                        <?php 
                                        $count=0;
                                            while($row=mysql_fetch_array($select)){ ?>
                                        <tr>
                                              <td><?php echo $row['store']; ?> </td>




                                        </tr>
                                    <?php } ?>
                            </tbody>
                        </table>

                    </div>

提前致谢

【问题讨论】:

  • 不相关,只是好奇...您是否注意到您将jquery.dataTables.css 包含了两次?

标签: jquery datatables


【解决方案1】:

thtd 的数量不匹配。 试试这样:

<tr>
    <td></td>
    <td><?php echo $row['store']; ?> </td>
 </tr>

【讨论】:

    猜你喜欢
    • 2013-05-08
    • 2014-01-16
    • 2014-04-15
    • 1970-01-01
    • 2013-11-15
    • 1970-01-01
    • 2013-07-19
    • 2016-09-24
    相关资源
    最近更新 更多