Reputation: 2581
what is the advantage of using pdo begintransaction, is this and mysql db lock are same?
I have a table with urls and status column, whenever my application loads 10 urls I need to update the status column as loaded. This application will be accessed by couple of users simultaneously, how would I prevent user B from loading the same urls loaded by user A and before the update of the status column.
Please could anyone help me.
Upvotes: 2
Views: 816
Reputation: 48304
Transactions and table locks do different things. In your case, probably the easiest way to accomplish what you want is:
Upvotes: 1
Reputation: 5291
PDO::beginTransaction will make possible to rollbak changes if something went wrong with PDO::rollback, while lock tables will not.
Upvotes: 1