Similar to the comment function, Table 1 contains the floor, time, and text fields. It is best to have php code similar to the comment function to implement floor auto-increment and lock during insertion (to prevent high concurrency and same floor ).
Table 1 contains the floor, time, and text fields.
How to Implement floor auto-increment and lock upon insertion (to prevent high concurrency from being the same as floor), it is best to have php code
Reply content:
Features similar to comments
Table 1 contains the floor, time, and text fields.
How to Implement floor auto-increment and lock upon insertion (to prevent high concurrency from being the same as floor), it is best to have php code
When creating a table, it means that the floor is auto-incrementing. For example
Create table 1 (
Floor int not null auto_increment primary,
Time...
)....
If the table has been created, use alter to modify it.
In this way, we can't repeat it, and it has nothing to do with high concurrency.
When creating a database, you must not only set floor to auto_increment, but also the storage engine to innodb. innodb is a row lock, Data Writing is paging, and myisam is a table lock, it is written by the server guard.