I have a PHP application that receives json from another application and writes them to the MySQL database. Before recording the data, I check the bank to see if the record has not been previously recorded. However, when I check the database now this afternoon, I come across two identical records. What could have happened? Was the client application so fast and before the first was recorded in the bank the second was also being processed? How can I protect myself from this? My Apache configuration is by default.
Thank you very much.