title: search between two dates that are entered manually
body: <p>I want to get the results between two dates when i enter the dates and click the search button. I have only put one date search so far. here's how it is shown. <a href="https://i.stack.imgur.com/toB7q.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/toB7q.jpg" alt="enter image description here"></a></p>
  
  <p>this is my <strong>index.php</strong> </p>
  
  <pre><code>      &lt;form  method="post" action="search.php?go"  id="searchform"&gt; 
          &lt;input  type="text" name="Date" placeholder="Date"&gt; 
          &lt;input  type="text" name="Location" placeholder="Location"&gt;
          &lt;input  type="submit" name="submit" value="Search"&gt; 
        &lt;/form&gt;
  </code></pre>
  
  <p>this is where i get the search results. <strong>search.php</strong> </p>
  
  <pre><code>&lt;?php
  
  /* showing table after searching for date */
  
  if (isset($_POST['submit'])) {
      if (isset($_GET['go'])) {
          $Date = $_POST['Date'];
          $Location = $_POST['Location'];
  
          $query = mysql_query("SELECT ID,Name,Location,Date,Category,LabourSupplier,InTime,OutTime,Day,DayRate,Salary,OTHours,OTrate,OTAmount,Allowance2,TotalSalary,Advance,SalaryToHand FROM attendance WHERE Date LIKE '%" . $Date . "%' AND Location LIKE '%" . $Location . "%' ORDER BY location DESC, LabourSupplier ASC", $connection)
          or die("Failed to query database" . mysql_error());
  
          while ($row = mysql_fetch_array($query)) {
  
              print "&lt;tr&gt;";
              print "&lt;td &gt;" . $row['ID'] . "&lt;/td&gt;";
              print "&lt;td &gt;" . $row['Name'] . "&lt;/td&gt;";
              print "&lt;td &gt;" . $row['Location'] . "&lt;/td&gt;";
              print "&lt;th &gt;" . $row['Date'] . "&lt;/th&gt;";
              print "&lt;td &gt;" . $row['Category'] . "&lt;/td&gt;";
              print "&lt;td &gt;" . $row['LabourSupplier'] . "&lt;/td&gt;";
              print "&lt;th &gt;" . $row['InTime'] . "&lt;/th&gt;";
              print "&lt;th &gt;" . $row['OutTime'] . "&lt;/th&gt;";
              print "&lt;th &gt;" . $row['Day'] . "&lt;/th&gt;";
              print "&lt;th &gt;" . $row['DayRate'] . "&lt;/th&gt;";
              print "&lt;th &gt;" . $row['Salary'] . "&lt;/th&gt;";
              print "&lt;th &gt;" . $row['OTHours'] . "&lt;/th&gt;";
              print "&lt;th &gt;" . $row['OTrate'] . "&lt;/th&gt;";
              print "&lt;th &gt;" . $row['OTAmount'] . "&lt;/th&gt;";
              print "&lt;th &gt;" . $row['Allowance2'] . "&lt;/th&gt;";
              print "&lt;th &gt;" . $row['TotalSalary'] . "&lt;/th&gt;";
              print "&lt;th &gt;" . $row['Advance'] . "&lt;/th&gt;";
              print "&lt;th&gt;" . $row['SalaryToHand'] . "&lt;/th&gt;";
              print "&lt;/tr&gt;";
          }
      }
  
  }
  print "&lt;/table&gt;";
  
  ?&gt;
  </code></pre>