I have a project that requires interface transmission, which is similar to recharge. I need to receive the order number and put it into the warehouse. There is a variable called a timestamp. Based on this timestamp, I can retrieve the recharge information after this timestamp.
But there is a problem. Yes, in order to prevent missing orders, when I search every 5 minutes, I will increase the timestamp by 28000 instead of 300000. This will cause the order number to be repeated and lead to failure. Thinkphp solves this problem, but it is embarrassing. I use is not a TP framework. Is there any other way to solve this problem?
漂亮男人2017-07-04 13:45:35
The key is repeated, which means the empty string inside. What does this have to do with what you said?
It means that the num column has multiple blank strings'' to be inserted into the database.
I didn’t understand your explanation at all.
高洛峰2017-07-04 13:45:35
If you use a unique index, the default value can be set to NULL. NULL values will not conflict, but 0
or empty strings ''
will conflict.