Jump to content

Mysql Update. *fixed*


MrFish
 Share

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 ._.

Edited by MrFish
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...