(Note: The column in the database is named "LOdatetime" and the table is named "Users")
<?php
session_start();
$con = mysqli_connect(SERVER, USER, PASSWORD, DATABASE);
$LOdatetime = date("Y-m-d h:i:s");
$query = "UPDATE Users SET LOdatetime='$LOdatetime' WHERE Email='$Email';";
$result = mysqli_query($con, $query);
session_destroy();
header("location:../index.php");
exit();
?>
Could you please advise me on how to correct my code so that I can successfully log the user's logout times in the database table? Thank you in advance!