数据表警告未知参数(表ID =' sample_1')

时间:2016-10-14 06:22:58

标签: javascript php jquery datatables

我正在使用jquery.dataTables.js。当我想从数据库中搜索数据时,我收到了这个错误:

  

数据表警告未知参数(表格ID =' sample_1'):请求的未知参数' 0'来自数据源1

这是我的源代码。

<table class="table table-striped table-bordered" id="sample_1">
     <thead>
         <tr>
             <th>ID</th>
             <th>T</th>
             <th>F</th>
             <th >L</th>
             <th >J</th>
             <th >Der</th>
             <th >G</th>
             <th >C</th>
          </tr>
     </thead>
     <tbody>

     <?php
          if(isset($_POST['submit'])){
                $searchValue='';

                if($_POST['city_name']=='a'){
                     $searchValue = $_POST['date'];
                     $myQuery = mysql_query("select * from users where date='$searchValue'");

                }
                if($_POST['city_name']=='b'){
                     $searchValue = $_POST['city'];
                     $myQuery = mysql_query("select * from users where city='$searchValue'");

                }
                if($_POST['city_name']=='c'){
                     $searchValue = $_POST['gender'];
                     $myQuery = mysql_query("select * from users where gender='$searchValue'");
                }
                if($_POST['city_name']=='d'){
                     $searchValue = $_POST['topic'];
                     $myQuery = mysql_query("select * from users where topic='$searchValue'");
                }

                //$number      =1;
                while($row = mysql_fetch_array($myQuery)    ){
                    //$id=$row['id'];
                    echo "<tr>
                                <td>"."1"."</td>
                                <td>".$row['d']."</td>
                                <td>".$row['n']."</td>
                                <td>".$row['l']."</td>
                                <td>".$row['j']."</td>
                                <td>".$row['t']."</td>
                                <td>".$row['g']."</td>
                                <td>".$row['c']."</td>

                            <tr>";
                            $number++;
                 }  
            }
     ?>
     </tbody>
</table>

我搜索了很多,但没有找到任何解决方案。

0 个答案:

没有答案