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:
<div class ="row">
<div class ="col-md-3">
<form action="" method="post" role="form">
<div class="form-group">
<label for="startdate">Start date:</label>
<input class="form-control" type="date" name="startdate" id="startdate" >
</div>
<div class="form-group">
<label for="enddate">Ending date:</label>
<input class="form-control" type="date" name="enddate" id="enddate" >
</div>
<button type="submit" class="btn btn-default">Submit</button>
<input type="hidden" name="submitted" value="1" />
</form>
</div>
</div>
<div class="panel panel-default">
<!-- Default panel contents -->
<!-- Table -->
<table class="table">
<thead>
<th>Nume</th>
<th>Prenume</th>
<th>Serviciu</th>
<th>Data</th>
<th>Ora</th>
<th>Email</th>
<th>Telefon</th>
<th>Status</th>
</thead>
<?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']);
?>
<tr>
<td><?php echo $list['nume']; ?></td>
<td><?php echo $list['prenume']; ?></td>
<td><?php echo $list['serviciu']; ?></td>
<td><?php echo $list['data']; ?></td>
<td><?php echo $list['ora']; ?></td>
<td><?php echo $list['email']; ?></td>
<td><?php echo $list['telefon']; ?></td>
<td><?php echo $list['status']; ?></td>
</tr>
<?php } ?>
</table>
</div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…