如何将datepicker的日期从HTML传递给PHP [英] How to pass datepicker's date to PHP from HTML
本文介绍了如何将datepicker的日期从HTML传递给PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想创建一个表格,了解在特定日期预订的数量。
我有一个日期选择器和一个提交按钮,我希望它应该检查所选日期并依赖于那个日期它应该搜索并显示数据库的结果。
这里是我的代码
I want to create a table for how many reservations are made on a particular day.
I have a date picker which and a submit button, i want it should check the selected date and depending on that date it should search and display result from database.
here's my code
<div class="alignleft">Select a Date: <input type="date" id="edate" name="edatee"></div>
<div class="alignleft"><input type="submit" value="View Reservations For Date: " id="viewres" onclick="viewtable();" ></div>
<div id="displaytable" style="display:none;" >
<table border='4' class="tablearrange" id="table">
<caption class="title">Auditorium Reservations</caption>
<tr>
<th>Sr. No</th>
<th>Name</th>
<th>Auditorium No.</th>
<th>Time Slot</th>
<th>Date</th>
<th>Department</th>
<?php
require('menu.php');
$query = "SELECT * FROM bookings;";
$result = mysqli_query($conn, $query);
$count = mysqli_num_rows($result);
if ($count!=0){
$no = 1;
while ($row = mysqli_fetch_array($result))
{
echo '<tr>
<td>'.$no.'</td>
<td>'.$row['name'].'</td>
<td>'.$row['audino'].'</td>
<td>'.$row['timeslot']. '</td>
<td>'.$row['date']. '</td>
<td>'.$row['dept']. '</td>
</tr>';
$no++;
}
}
else
{
echo "No Registrations for the given date";
}
?>
</tr>
</table>
<input type="button" value="Hide Table" id="hideres" onclick="hidetable();" name="hidet" >
</div>
我尝试过:
我什么都想不到。
What I have tried:
I could not think of anything .
推荐答案
query =SELECT * FROM bookings;;
query = "SELECT * FROM bookings;";
result = mysqli_query(
result = mysqli_query(
conn,
这篇关于如何将datepicker的日期从HTML传递给PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文