I have an html page which displays a table. The values in the table are taken from database. The columns of the table are : name, score, birthDate.
我有一个显示表格的html页面。表中的值取自数据库。表格的列是:name,score,birthDate。
I added two calanders on the top of the table using :
我使用以下方法在表格顶部添加了两个calanders:
<input type="text" id="id1" name="start_date" class="form-control input-lg ff-1 required datepicker pointer" value="">
I added another one for the end_date.
我为end_date添加了另一个。
what I need is :
我需要的是:
When the user selects start and end dates, I want the values in the table to be refreshed, and only entries with date between start_date and end_date should be displayed. I know how to include both date values in the sql query and so on, but how can i trigger this query and how can i replace the values which are already present in the table with the new values .
当用户选择开始日期和结束日期时,我希望刷新表中的值,并且只显示日期介于start_date和end_date之间的条目。我知道如何在sql查询中包含两个日期值等等,但是如何触发此查询以及如何使用新值替换表中已存在的值。
Note: I do not need sample code, I just need to know the steps please as I am new to php
注意:我不需要示例代码,我只需要知道步骤,因为我是php的新手
1 个解决方案
#1
0
You need some javascript here:
你需要一些javascript:
- Attach event on changing dates in calendar or on clicking some button.
- In event's handler make an ajax request to server and pass dates to server script.
- Server will return plain html or some json, use some jquery (for example) methods to clear current table content and insert new one.
在日历中更改日期或单击某个按钮时附加事件。
在事件的处理程序中向服务器发出ajax请求并将日期传递给服务器脚本。
服务器将返回普通的html或一些json,使用一些jquery(例如)方法来清除当前表内容并插入新的内容。
#1
0
You need some javascript here:
你需要一些javascript:
- Attach event on changing dates in calendar or on clicking some button.
- In event's handler make an ajax request to server and pass dates to server script.
- Server will return plain html or some json, use some jquery (for example) methods to clear current table content and insert new one.
在日历中更改日期或单击某个按钮时附加事件。
在事件的处理程序中向服务器发出ajax请求并将日期传递给服务器脚本。
服务器将返回普通的html或一些json,使用一些jquery(例如)方法来清除当前表内容并插入新的内容。