« first day (2274 days earlier)      last day (384 days later) » 

9:42 PM
Hi, anyone can help me with this question? stackoverflow.com/questions/44231995/…
 
 
2 hours later…
11:17 PM
@ziiweb So, in normal MySQL use that would never happen
That could only happen if PDO (or whatever) was maintaining a pool of connections
And, every time you interacted with the database, you were given a different connection from the pool.
You are right to be nervous about selecting MAX(id) from the table, that is even less reliable
There are two things to do: first, learn about how PDO (or whatever) is doing when it comes to pooling database connections
But the higher issue, which you should really be fixing even if you weren't dealing with connection pooling, is that you should be running both inserts inside of the same transaction
So that if there was any issue at all with any of the inserts, all of the inserts would not be committed
So that you would never be able to be in a spot where some data could be written, and other data could not be written
 

« first day (2274 days earlier)      last day (384 days later) »