Jump to content

[SOLVED] Php update NOW() not updating....


pneudralics

Recommended Posts

You're comparing to the string NOW() since you surrounded it with quotes.

try

//Update login datetime
$updateloginq = "UPDATE user SET login = NOW() WHERE email = \"$email\" LIMIT 1";
mysql_query ($updateloginq);

or better yet,

//Update login datetime
$updateloginq = "UPDATE user SET login = NOW() WHERE email = '$email' LIMIT 1";
mysql_query ($updateloginq);

You're free to use single quotes inside double quotes without escaping them (and vice versa)

You're comparing to the string NOW() since you surrounded it with quotes.

try

//Update login datetime
$updateloginq = "UPDATE user SET login = NOW() WHERE email = \"$email\" LIMIT 1";
mysql_query ($updateloginq);

or better yet,

//Update login datetime
$updateloginq = "UPDATE user SET login = NOW() WHERE email = '$email' LIMIT 1";
mysql_query ($updateloginq);

You're free to use single quotes inside double quotes without escaping them (and vice versa)

 

Thanks alot!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.