Quand je consulte le panneau de l'utilisateur sur le forum, je trouve le titre "Votre activité" et ces deux informations : Enregistré le et Dernière visite. Je comprends que c'est enregistré et je veux faire pareil chez moi. A la connexion j'ai ceci : etat='connecté', arrivee='$date' et ça fonctionne mais à la déconnexion rien ne se passe dans la base.
Voici ma page de déconnexion :
session_start();
if ($_SESSION['acces']!="oui") {
header("Location:http://localhost/monsite.cg");
}
echo $_SESSION['matricule'];
echo "<hr /> ";
try
{
$bdh = new PDO('mysql:host=localhost;dbname=monsite;charset=utf8', 'root', '');
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
$date=date("Y/m/d H:i:s");
$aze = $bdh->prepare("UPDATE comptes SET etat='déconnecté', depart='$date' WHERE matricule =:matricule");
$aze->execute(array(':matricule'=>$_SESSION['matricule']));
$aze->closeCursor();
session_destroy();
header("location:http://localhost/monsite.cg/connexion");
Je vous écoute..