I have the following code on 1 page that works perfectly fine:
$log = "UPDATE users SET loggedIn = '1' WHERE username= '$username' ";
However, upon changing that code slightly, something is going wrong escaping my characters.
$log = "UPDATE users SET loggedIn = '0' WHERE username= '$_SESSION["username"]' ";
The issue lies within my syntax here: '$_SESSION["username"]'
Unfortunately, the $username variable is not declared in this page.
HOWEVER, $_SESSION['username'] is declared, and an echo of it returns exactly what I need.
I've been trying different variations of single quotes, double quotes, and backslashes for hours. Can someone tell me what I am doing wrong? ..
Solved by Enstage