PHP code example of nomensa / bulk-inserter
1. Go to this page and download the library: Download nomensa/bulk-inserter library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nomensa / bulk-inserter example snippets
use Nomensa\BulkInserter\BulkInserter;
class ExampleSeeder
{
public function run()
{
$bulkInserter = new BulkInserter('users',['name','email']);
for ($i = 0; $i < 1000; $i++) {
$bulkInserter->addRow( '("User ' . $i . '","user' . $i . '@example.com")' );
}
$bulkInserter->insert();
}
}