I have looked but cannot see this query anywhere. That may be because it is a stupid question - I don't know what I don't know!
I'm half way through a closed-user beta with many horrors and more security holes than a Swiss cheese. It is just a proof-of-concept thing to see if anyone is interested. It will eventually be properly coded by someone who knows what they are doing. (At the moment it is just me seeing it.)
I have hit a new problem. Everything is going nicely but sometimes if I hit a PHP error the wrong data are written to the database which causes problems later on when the data are read. It is perfectly valid data so the DB does not throw an error but I want to crash out and go and fix it WITHOUT any data staying in the DB until the PHP is fixed.
I have not used beginTransaction
commit
rollback
yet at all (I struggle with PDO a bit) but it seems the right area for this problem.
SO....
Is there a way of putting a beginTransaction
at the start of a fairly busy "processing" file and then do a commit
at the end and have it fail on a PHP fail?
If there is a solution then I will go away and redo files so that I can use this otherwise, for this very untidy beta, I will ignore beginTransaction
etc
Grateful for any pointers cannot find this info anywhere. I know if there is a way of doing it there will be lots of answers but if so, I must be be using bad search strings.
EDIT: PS I should have said PHP warnings and errors. Most of my problems are associated with warnings so I end up with 0 stored in the DB when it should be 150 because a variable is misnamed due to a typo - that sort of thing.