Codes here !
Moderators: macek, egami, gesf
by kelvin24 » Thu Aug 23, 2012 6:55 am
What is wrong with this syntax?
- Code: Select all
$log="UPDATE log SET logouttime='$time' WHERE username='$_SESSION['username']'";
-
kelvin24
- New php-forum User

-
- Posts: 12
- Joined: Mon Aug 13, 2012 5:11 pm
by Nullsig » Thu Aug 23, 2012 7:58 am
Really you should escape out of the string when dealing with PHP variables. In this case the single quotes in your session variable are ending the quote surrounding it prematurely.
- Code: Select all
$log="UPDATE log SET logouttime='" . $time . "' WHERE username='" . $_SESSION['username'] . "'";
-

Nullsig
- php-forum Fan User

-
- Posts: 981
- Joined: Thu Feb 17, 2011 6:52 am
- Location: Racine, WI
Return to mySQL & php coding
Who is online
Users browsing this forum: No registered users and 1 guest