title: PHP - How to make a search engine to search from a date to another date
body: <p>I am trying to make a php file to search in my database table "attendance". <br>
  I want to get the values from a date to another date.</p>
  
  <p>For e.g. |Date1| |Date2|<br>
  |Values displayed from date1 to date2|</p>
  
  <p>My table contains <code>emp_id</code>, <code>Date</code>, <code>Day</code>, <code>Time_In</code>, <code>Time_Out</code>, <code>Worked</code>, <code>Overtime</code>, <code>Less_Hours</code>, <code>Transport_In</code>, <code>Transport_Out</code>.</p>
  
  <p>I hope someone can help me.
  Thanks in advance<br><br>
  <strong>EDIT 1:</strong></p>
  
  <pre><code>&lt;?php
      require_once 'Connection.simple.php';
      $conn = dbConnect();
      $OK = true;
      if (isset($_GET['employee_id'])) {
          $data = "%".$_GET['employee_id']."%";
          $sql = 'SELECT * FROM employee WHERE employee_id like ?';
          $stmt = $conn-&gt;prepare($sql);
          $results = $stmt-&gt;execute(array($data));
          $rows = $stmt-&gt;fetchAll();
          $error = $stmt-&gt;errorInfo();
      }
      if(empty($rows)) {
          echo "&lt;tr&gt;";
              echo "&lt;td colspan='4'&gt;There were not records&lt;/td&gt;";
          echo "&lt;/tr&gt;";
      }
      else {
          foreach ($rows as $row) {
              echo "&lt;tr&gt;";
                  echo "&lt;td&gt;".$row['employee_id']."&lt;/td&gt;";
                  echo "&lt;td&gt;".$row['name']."&lt;/td&gt;";
                  echo "&lt;td&gt;".$row['email']."&lt;/td&gt;";
                  echo "&lt;td&gt;".$row['telephone']."&lt;/td&gt;";
              echo "&lt;/tr&gt;";
          }
      }
  ?&gt;
  </code></pre>
  
  <p>I have tried this simple code to search in my database table but i don't know how to go further.
  I am just a begginer<br><br>
  Rgds<br>
  Akshat</p>
  
  <p><strong>EDIT 2</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          jQuery(document).ready(function($) {
              $('.btnSearch').click(function(){
                  makeAjaxRequest();
              });
  
              $('form').submit(function(e){
                  e.preventDefault();
                  makeAjaxRequest();
                  return false;
              });
  
              function makeAjaxRequest() {
                  $.ajax({
                      url: 'php/search.php',
                      type: 'get',
                      DateFrom: {DateFrom: $('input#DateFrom').val()},
                      DateTo: {DateTo: $('input#DateTo').val()},
                      success: function(response) {
                          $('table#resultTable tbody').html(response);
                      }
                  });
              }
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>This is the code that i am using on the index.html page</p>
  
  <p>Rgds<br>
  Akshat</p>