Reputation: 515
I'm executing thousand of 'insert' in my mysql Database with a php file. If the php crash before finishing, to be sure that my update failed, I don't want to have 5000 'insert' on 10 000 done but 0.
Can you tell me how that's possible?
Upvotes: 0
Views: 91
Reputation: 156
You can do this by using a Transaction. The implementation varies depending on the database. A transaction will ensure that the entire task is completed, or none of it is, as you've described.
Upvotes: 4