Like the title says how do i delete email when user logs out. I have this code but it doesn't work.
<?php
session_start();
$email = $_SESSION['email'];
$sql = "DELETE FROM onlineusers WHERE email = $email";
mysqli_query($link, $sql);
session_destroy();
header("Location: index.php");
?>