PHP code example of pedrosoares / sqlfileloader

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

    

pedrosoares / sqlfileloader example snippets


"    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "pedrosoares/sqlfileloader": "1.0.*"
}

$c = new SqlFileLoader("PATH to the sql file");
foreach($c->getStatements() as $sqlCommand){
    DB::statement($sqlCommand);
}