How to save one connection (or one transaction) to MySQL on different pages of the site in PHP? This is necessary when we fill in a lot of settings on different pages, and then we need to roll them back.

    1 answer 1

    Making long transactions is a bad idea in principle - it is very likely that there will be problems with locks. In my opinion, a good solution would be to store the settings in the session, and write to the database already in one transaction at the end.