Possible delay when using NOW () in MySQL Query?

I learn MySQL and PHP through a book in a library. I improved the security of the password encryption system by changing the password store from

password=SHA('password')

to

password=SHA(CONCAT('password', '--', registration_date))

where registration_dateis the timestamp when the user has registered.

Current user registration code:

INSERT INTO users (first_name, last_name, email, password, registration_date) 
VALUES ('first_name', 'last_name', 'email', SHA(CONCAT('password', '--', NOW())), NOW());

Will I need to worry about two different NOW () functions? Do they have the opportunity to have a slightly different time? I tried this with a few queries and it seems to be working fine.

If a problem occurs, how would I fix it?

+5
source share
2 answers

No problems. From the manual:

() , . ( NOW() , .)

, NOW() , .

+3

. :

() , , .

(http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_now) , .

. , (, HA), NOW(), .

0

All Articles