I have ZERO transaction code in my PHP script. That was done on purpose. My application is too simple to need it.
Starting less than a week ago, without any code changes on my part, records written to several of my tables are simply vanishing. I get no error when they are written, and using some debugging, I can actually see the changes/additions (via phpMyAdmin) showing up. But when the script ends (which closes the database connection), the records simply vanish. The only “proof” they were ever there is in my debugging messages and the increased autoincrement values.
So my (simple?!?!?) question is this: Is it possible, and if so how, for PHP 8.2 using the PDO interface and MariaDB 11.x to “decide” to use transactions even when they are not part of the PHP code?
I have no beginTransaction / commit / rollback in my code anywhere. Yet it certainly appears as though a transaction was in place and never committed, so it automagically rolled back when the connection closed.
Again, this all started during a period when I did no code database related changes.
My hosting company does not admit to any updates to MariaDB or PHP for any account, much less mine.
I guess a secondary question might be is there a way to command PDO to never, ever, ever use transactions?
Thanks muchly…
I have spent several days debugging this, but other than error_log entries stating the record was there, and what it returned, I don’t really have any “proof” that this is happening. In a previous question I posted some of my code and error_log entries, and nobody commented on errors/issues from them.
David Lee Crites is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
23