Datatable Sorting, Pagination and Search Hidden for PHP MYSQL Search Result

Datatable Sorting, Pagination and Search Hidden for PHP MYSQL Search Result

KinfeKinfe Posts: 1Questions: 1Answers: 0

I cant get Sort icons, pagination buttons, Search Form jQuery datatables Work for PHP MYSQL Dynamic Data.

I can see Sort icon, Next and Previous button and Search form when there is no record displayed the problem is when there is dynamic data coming from MYSQL table

HTML part of DataTables

   <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                <thead>
                                    <tr>
                                        <th>Brand Name</th>
                                        <th>Size</th>
                                        <th>SW</th>
                                        <th>OD</th>


                                    </tr>
                                </thead>
                              <tbody>

//Here is PHP Code i used to display the record

   $record = mysqli_query($con,"SELECT * FROM table_name ORDER BY Manufacturer");
   while ($row = mysqli_fetch_array($record)) {
   if($row['RC']!="" && $row['SW']!="")
     {
      if($ag=="" && $size1=="" && $size=="" && $lcc=="" && $scc=="" && $smallsw==""  && $largesw=="" && $smallrc=="" && $largerc=="" && $txtsize=="" && $small== "" && $large == "")  
     {
     }

     elseif ($row['Tread_Design']==$R1W) 
        {    
      echo "<tr>";


                        //echo "<td style=' width:300px;text-align:left; padding-left: 10px;vertical-align: middle;'>";echo $row['Manufacturer'];echo"</td>";
                        echo "<td style=' width:150px;  text-align:left; padding: 10px;vertical-align: middle;'>";echo $row['Brand_Name'];echo"</td>";
                        echo "<td style='width:110px;  text-align:left; vertical-align: middle;'>";echo $row['Tire_Size'];"</td>";
                        echo "<td style='width:100px;  text-align:left; vertical-align: middle;'>";echo $row['SW'];"</td>"; 
                        echo "<td style='width:100px; text-align:left;vertical-align: middle;'>";echo $row['OD'];"</td>";

    echo '</tr>';

}
}......

And Here is the JS Code

 <script>
   $(document).ready(function() {
      $('#dataTables-example').DataTable({
            responsive: true,
            bPaginate: true,

      });
    });
 </script>
This discussion has been closed.