【发布时间】:2015-05-27 17:42:34
【问题描述】:
我想显示两个日期之间的数据。但我希望能够选择这两个日期。我不知道在哪里或如何存储这些日期以便能够在 SELECT 中添加一个变量。请在回答时非常具体。谢谢! 这就是我的代码的样子:
<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>
【问题讨论】: