title: How do I pagination using query limit, offset, and jquery datatable?
body: <p>I made a page using the data table. However, as the number of data increases, the speed of data loading slows down, so we try to proceed paging. But I don't know how to modify it in the current code. How should it be modified?</p>
  
  <p>in this my datatable scipt</p>
  
  <pre><code> $(function() {
  
            $('#datatable1').DataTable({
              responsive: true,
              order: [[ 1, "desc" ], [ 2, "desc"]],
              language: {
  
  
                searchPlaceholder: 'Search...',
                sSearch: '',
                lengthMenu: '_MENU_ items/page',
              },
              dom : 'Bfrtip',
  
              buttons: [
                  'copy', 'excel', 'print'
              ]
            });
          });
  </code></pre>
  
  <p>in this sql query</p>
  
  <pre><code>    $sql = "SELECT id,  DATE_FORMAT(tranDate,'%Y-%m-%d') as tranDate, tranTime, date, cmd, paymethod, amount, orgRefNo, orgTranDate FROM noti_card_data  WHERE  mbrNO = '1'";
  
  in this table view code
  
  
      if($result = mysqli_query($link, $sql)){               
  
              if(mysqli_num_rows($result) &gt; 0){
  
                  echo "&lt;table id='datatable1' class = table style = 'width: 100%; font-size:12.5px; font-family:nanum; background-color:transparent;'&gt;";
                  echo "&lt;thead &gt;";
                  echo "&lt;tr&gt;";
                  echo "&lt;th&gt;No&lt;/th&gt;";
                  echo "&lt;th&gt;amount&lt;/th&gt;";
                  echo "&lt;/tr&gt;";
                  echo "&lt;/thead&gt;";
  
                  echo "&lt;tbody&gt;";
              while($row = mysqli_fetch_array($result)){
                  echo "&lt;tr&gt;";
                  echo "&lt;td&gt;" . $row['id'] . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . number_format($row['amount']) . "&lt;/td&gt;";
                  echo "&lt;/tr&gt;";
              }
                  echo "&lt;/tbody&gt;";                            
                  echo "&lt;/table&gt;";
                  // Free result set
                  mysqli_free_result($result);                                  
              } 
  
              else{
  
              }
          }     
  
      else{
      echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
      } 
  
      // Close connection
      mysqli_close($link);   
  </code></pre>
  
  <p>in this view
  <a href="https://i.stack.imgur.com/hXdrM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hXdrM.png" alt="enter image description here"></a></p>
  
  <p>how to using pagination </p>