【发布时间】:2021-10-19 10:11:32
【问题描述】:
这个日期获取方法来获取另一个页面的日期
$fromdate = $_GET[fromDate];//14/10/2021
$todate = $_GET[todate];17/10/2021
$collect_Amt = $conn->query("SELECT lvlCol_amt,lvlCol_type,lvlCol_directEarn_perct,lvlCol_directEarn_amt,lvlCol_associateId,lvlCol_collectId,lvlCol_dateTime from `t_lvl_collect` where lvlCol_dateTime between '$_GET[fromDate]' AND '$_GET[todate]' AND lvlCol_associateId = $MemberId ORDER BY lvlCol_dateTime DESC");
但返回数据是 15/10/2021,15/10/2021 和 16/10/2021
17/10/2021 请不要显示
帮忙?
【问题讨论】:
-
您使用的是字符串,而不是日期?您也对 SQL 注入持开放态度。使用准备好的语句。