title: Select * FROM table WHERE date between two selected dates
body: <p>I want to display data between two dates. But I want to be able to select those two dates. I don`t know where or how to store those dates in order to be able to add a variable in the SELECT. Please be very specific when you answer. Thank you!
  This is how my code looks like:</p>
  
  <pre><code>&lt;div class ="row"&gt;
  
  
  &lt;div class ="col-md-3"&gt;
  
  
      &lt;form action="" method="post" role="form"&gt;
  
          &lt;div class="form-group"&gt;
  
              &lt;label for="startdate"&gt;Start date:&lt;/label&gt;
              &lt;input class="form-control" type="date" name="startdate" id="startdate" &gt;
  
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
  
              &lt;label for="enddate"&gt;Ending date:&lt;/label&gt;
              &lt;input class="form-control" type="date" name="enddate" id="enddate" &gt;
  
          &lt;/div&gt;
  
          &lt;button type="submit" class="btn btn-default"&gt;Submit&lt;/button&gt;
          &lt;input type="hidden" name="submitted" value="1" /&gt;
  
  
      &lt;/form&gt;
  
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="panel panel-default"&gt;
  &lt;!-- Default panel contents --&gt;
  
  
  &lt;!-- Table --&gt;
  &lt;table class="table"&gt;
      &lt;thead&gt;
          &lt;th&gt;Nume&lt;/th&gt;
          &lt;th&gt;Prenume&lt;/th&gt;
          &lt;th&gt;Serviciu&lt;/th&gt;
          &lt;th&gt;Data&lt;/th&gt;
          &lt;th&gt;Ora&lt;/th&gt;
          &lt;th&gt;Email&lt;/th&gt;
          &lt;th&gt;Telefon&lt;/th&gt;
          &lt;th&gt;Status&lt;/th&gt;
      &lt;/thead&gt;
  
  
  
      &lt;?php
  
          $query = "SELECT * FROM rezervari2 ORDER BY data ASC";
          $result = mysqli_query($dbc, $query);
  
          while($list = mysqli_fetch_assoc($result)){ 
  
              $list = data_rezervare($dbc, $list['idrezervare']);
      ?&gt;   
  
      &lt;tr&gt;
          &lt;td&gt;&lt;?php echo $list['nume']; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $list['prenume']; ?&gt;&lt;/td&gt;            
          &lt;td&gt;&lt;?php echo $list['serviciu']; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $list['data']; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $list['ora']; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $list['email']; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $list['telefon']; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $list['status']; ?&gt;&lt;/td&gt; 
      &lt;/tr&gt;
  
       &lt;?php  } ?&gt;     
  
  &lt;/table&gt;
  
  
  
  &lt;/div&gt;
  </code></pre>