Jump to content

Mysql Update. *fixed*


MrFish

Recommended Posts

I'm adding a last login feature for my site, but the last_login field won't update when I run the login script. Everything else turns out ok. My code looks like this-

mysql_select_db('b17_3648160_maindb', $con) or die(mysql_error());$lastlogin = date("y-m-d h:i a");$query="UPDATE users SET last_login='$lastlogin' WHERE username='$username'";$run=mysql_query($query);

The database looks like this-lastloginerror.jpgI think it might be a timestamp error. I'll keep trying.edit: it was a timestamp error ._.

Link to comment
Share on other sites

By the way you should hash your passwords so that even if someone hacks your DB they can't find out the passwords.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...