Thank you, but I find the solution myself also with explode here is the modified part of code for info:
// SQL statement to build recordset
if (isset($Debut))
{
$Debut=explode("/",$Debut);
$ResultatDebut="#".$Debut[2]."/".$Debut[1]."/".$Debut[0]."#";
$clauseDebut = " WHERE JOUR BETWEEN $ResultatDebut";
}
if (isset($Fin))
{
$Fin=explode("/", $Fin);
$ResultatFin="#".$Fin[2]."/".$Fin[1]."/".$Fin[0]."#";
$clauseFin = " AND $ResultatFin+1";
}
$rs = $conn->Execute("SELECT JOUR,TAUX,DOSE,TEST,REMARQUE FROM Tbl_GLYCEMIE" . $clauseDebut . $clauseFin);
I evryone, I made a application with a link with Access database
on my application they are two fields for inputing dates within a period for search on the data with a SQL query, my script work fine but I must put the Date in the format m/d/YYYY an I would like to input them in european format dd/mm/YYYY the name of these variables are $Debut and $Fin here is my php script can anyone help me ? I am seekink all 2days without result.
thank's
<?php
include("identification.inc.php");
include("haut.inc.php");
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
// Microsoft Access connection string.
$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ= C:\Program Files\Apache Group\Apache2\htdocs\Sucre\Sucre.mdb");
?>
<p align="left"> :: accueil</p>
<form action="index.php" method="post">
<input type="text" name="Debut" value="<?php echo $Debut; ?>">
<input type="text" name="Fin" value="<?php echo $Fin; ?>">
<input type="submit" value="Afficher Selection">
</form>
<table width="90%" align="center" border="1">
<tr>
<td class="intitule">Date Heure</td>
<td class="intitule">Glycémie</td>
<td class="intitule">Dose Insuline</td>
<td class="intitule">Test</td>
<td class="intitule">Remarque</td>
</tr>
<?php
// SQL statement to build recordset
if (isset($Debut))
{
$clauseDebut = " WHERE JOUR BETWEEN #$Debut#";
}
if (isset($Fin))
{
$clauseFin = " AND #$Fin#+1";
}
$rs = $conn->Execute("SELECT JOUR,TAUX,DOSE,TEST,REMARQUE FROM Tbl_GLYCEMIE" . $clauseDebut . $clauseFin);
// Display all the values in the records set
while (!$rs->EOF) {
$Jour = $rs->Fields("JOUR");
$Glycemie = $rs->Fields("TAUX");
$Dose = $rs->Fields("DOSE");
$Test = $rs->Fields("TEST");
$Remarque = $rs->Fields("REMARQUE");
echo "<tr>";
echo "<td>".date("d/m/Y H:i",$Jour->value)."</td>";
echo "<td>".$Glycemie->value."</td>";
echo "<td>".$Dose->value."</td>";
echo "<td>".$Test->value."</td>";
echo "<td>".$Remarque->value."</td>";
echo "</tr>";
$rs->MoveNext();
}
$rs->Close();
$conn->Close();
echo "</table>";
?>
<?php
include("bas.inc.php");
?>😕 😕