After the user logs out, it basically deletes the all the data in their table that includes their id code in any of the rows.
$idcode = $_SESSION['idcode'];
$idicao = $_SESSION['idicao'];
if(isset($_POST['logout'])) {
$sql = "DELETE FROM $idicao WHERE idcode=".$idcode."";
mysql_query($sql);
}
session_unset();
session_destroy();
mysql_close($dbid);
header("Location: login.php");
?>
The variables are echoed on the page correctly, and session_start is at the top. The only problem is that the records from the tables are not being deleted.
You are saying that the sql-variable outputs: DELETE FROM Test WHERE idcode=test
Test should be in single quotes like this: