user628298
user628298

Reputation: 287

PDO INSERT - More than one

I have a question how do you do when you need to more than 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?

Upvotes: 1

Views: 115

Answers (1)

Rijk
Rijk

Reputation: 11301

I think transactions is what you need.

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

Upvotes: 5

Related Questions