Home >Backend Development >PHP Tutorial >PHP timestamp application example

PHP timestamp application example

WBOY
WBOYOriginal
2016-07-25 09:04:511104browse
A timestamp is a set of random numbers generated based on the current system time. Timestamps are generally used as a basis for judging the uniqueness of data.

Assumptions: Bank A and Bank B open your account almost at the same time and see the original deposit of 1,000 yuan in your account, and then both banks want to add a deposit of 500 yuan to your account. Then, Bank A changes the amount from 1,000 yuan to 1,500 yuan, and at the same time, Bank B also changes the amount from 1,000 yuan to 1,500 yuan. That's bad! In the end, you end up with only 1,500 yuan in your bank account instead of the 2,000 yuan you should have, which is equivalent to a loss of 500 yuan! This is a serious problem caused by modifications without locking the data. However, we can solve this problem neatly through timestamps.



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn