 <?php  
 $connect = mysqli_connect("localhost", "root", "", "kahuria");  
 $query ="SELECT * FROM courses ORDER BY courseID DESC";  
 $result = mysqli_query($connect, $query);  
 ?>   
 
            
           <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>  
           <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />  
           <script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>  
           <script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script>            
           <link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css" />  
      
                <div class="table-responsive">  
                     <table id="employee_data" class="table table-striped table-bordered">  
                          <thead>  
                               <tr>  
                                    <td>id</td>  
                                    <td>Course Name</td>  
                                    <td>Duration</td>
                                    <td>Fees(KES)</td>
                                    <td>Fees(USD)</td>  
                               </tr>  
                          </thead>  
                          <?php  
                          while($row = mysqli_fetch_array($result))  
                          {  
                               echo '  
                               <tr>  
                                    <td>'.$row["courseID"].'</td>  
                                    <td>'.$row["courseName"].'</td>  
                                    <td>'.$row["duration"].'</td>
                                    <td>'.$row["feeKshs"]. '</td>
                                    <td>'.$row["feeUsd"].'</td>  
                               </tr>  
                               ';  
                          }  
                          ?>  
                     </table>  
                </div>  
           </div>  
       
 <script>  
 $(document).ready(function(){  
      $('#employee_data').DataTable();  
 });  
 </script>  