我想从表日期最大值和日期分钟中选择。使用表格
$datemax=$_POST['maxdate'];
$datemin=$_POST['mindate'];
("select * from demande inner join gestionnaire on gestionnaire.idgab = demande.idgab where demande.idgab='$idgabsess' order by demande.dateincidnt")
我想从列dateincidnt中选择($ datemax)------> (datemin)
答案 0 :(得分:2)
您可以使用MySQL
between
条款。
SELECT * FROM table WHERE date BETWEEN $start_date AND $end_date
在您的代码中
select * from table where dateincidnt between $datemax and datemin
答案 1 :(得分:2)
使用BETWEEN
运算符
$sql = "select * from demande
inner join gestionnaire on gestionnaire.idgab = demande.idgab
where demande.idgab='$idgabsess'
and dateincidnt between $datemin and $datemax
order by demande.dateincidnt";