-2

i want to select from a table date max and date min . using form

$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")

i want to select from column dateincidnt where ($datemax) ------> (datemin)

4

2 に答える 2

2

You can use MySQL between clause.

SELECT * FROM table WHERE date BETWEEN $start_date AND $end_date

In your code

select * from table where dateincidnt between $datemax and datemin
于 2013-03-09T09:24:47.093 に答える
2

Use the BETWEEN operator

$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";
于 2013-03-09T09:24:56.190 に答える