PHP code example of easydot / batch-update

1. Go to this page and download the library: Download easydot/batch-update 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/ */

    

easydot / batch-update example snippets


(new UpdateBatch('table_name', $batchArrayData))->run();


# Specify primary key
(new UpdateBatch('table_name', $batchArrayData, 'primary_key'))->run();

# Add filter where
(new UpdateBatch('table_name', $batchArrayData, 'primary_key'))
    ->where('type', '=', $this->tmpOfferType)
    ->run();

# Support where
(new UpdateBatch('table_name', $batchArrayData, 'primary_key'))
    ->where('type', '=', $this->tmpOfferType)
    ->run();
    
# Support whereIn
(new UpdateBatch('table_name', $batchArrayData, 'primary_key'))
    ->whereIn('id', [1, 2, 3])
    ->run();
    
# Another methods
(new UpdateBatch('table_name'))
    ->multipleData($batchDataToUpdate)
    ->referenceColumn('primary_id')
    ->run();