开发者

PDO INSERT - More than one

开发者 https://www.devze.com 2023-04-03 06:03 出处:网络
I have a question how do you do when you need to more t开发者_StackOverflowhan 1 register in a database with PDO?

I have a question how do you do when you need to more t开发者_StackOverflowhan 1 register in a database with PDO?

And every record has to be registered in the database, Can not give any error in all it has to be registered.

Example 6 register with PDO on a page.

But if the last record of the error? How do I delete the 5 that was already in the DB?, Best way to do this?

I'll have to pass all QUERY and verified in the IF one by one? or have a better way to do this?

Or this type of error will never occur?


I think transactions is what you need.

Here's another tutorial: http://www.phpro.org/tutorials/Introduction-to-PHP-PDO.html#11

0

精彩评论

暂无评论...
验证码 换一张
取 消