1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
if ($pDate1 == NULL || $pDate2 == NULL)
{
$REQ_Total_Arrets_Station = $bdd->query('SELECT
COUNT(Arret.IDArret) AS Comptage_1,
Station.nomStation AS nomStation,
Ligne.NomLigne AS NomLigne,
Station.IDStation AS IDStation,
ligne.IDLigne AS IDLigne
FROM
Ligne,
Arret,
Station
WHERE
Station.IDStation = Arret.IDStation
AND Ligne.IDLigne = Arret.IDLigne
GROUP BY
Arret.IDStation,
Arret.IDLigne
ORDER BY
Comptage_1 DESC');
}
else
{
$REQ_Total_Arrets_Station = $bdd->prepare('SELECT
COUNT(Arret.IDArret) AS Comptage_1,
Station.nomStation AS nomStation,
Ligne.NomLigne AS NomLigne,
Station.IDStation AS IDStation,
ligne.IDLigne AS IDLigne
FROM
Ligne,
Arret,
Station
WHERE
Station.IDStation = Arret.IDStation
AND Ligne.IDLigne = Arret.IDLigne
AND arret.Date_arret >= ?
AND arret.Date_arret <= ?
GROUP BY
Arret.IDStation,
Arret.IDLigne
ORDER BY
Comptage_1 DESC');
$REQ_Total_Arrets_Station->execute(array($pDate1,$pDate2));
} |
Partager