I am salting users' passwords with a mysql column which has the type timestamp and default is CURRENT TIMESTAMP.
Both of my timezones for mysql and php are identical.
My problem is this,
$q = $dbc -> prepare("INSERT INTO accounts (password) VALUES (?)"); $q -> execute(array(hash('sha512', 'somestaticsalt' . $_POST['password'] . time()))); Now as you can see I have to hash with PHP's time function and on the mysql side it is a default timestamp.
Somewhere there must be an overlap because where users' are entering correct information it is still failing to match the hashed password in the database.
I have tried inserting time() into the joined column but it returns at 1970. Also I do not want to save the timestamp as an INT as this isn't the correct thing to do, so what is your thoughts?