ThingEngineer / PHP-MySQLi-Database-Class

Wrapper for a PHP MySQL class, which utilizes MySQLi and prepared statements.
Other
3.3k stars 1.34k forks source link

Insert multiple datasets at once #915

Open taifunorkan opened 4 years ago

taifunorkan commented 4 years ago

Whereas inserting in a loop is working perfectly, insert multiple datasets at once will have one flaw, if i am not wrong.

I tried the following.
$feeds = $con->insertMulti('feeds', (array) $feeds);

If only one feed cannot be inserted, maybe because it is a duplicate, the rest of the feeds will not be inserted either and $feeds return false. So it was with my example.

Like I said before looping through the array and using the normal (single) inserting method instead only bypasses the duplicate and inserts all other entries. This is what at least I want.

Last not least thank you for your precius library.