2017 © Pedro Peláez
 

library pdo-bulk

A PHP Pdo insert wrapper which allows you to bulk insert records wich contain subqueries.

image

nextpertise/pdo-bulk

A PHP Pdo insert wrapper which allows you to bulk insert records wich contain subqueries.

  • Sunday, March 1, 2015
  • by teunis90
  • Repository
  • 2 Watchers
  • 2 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 5 % Grown

The README.md

PdoBulk - A PHP Pdo insert wrapper

Build Status Scrutinizer Code Quality, (*1)

Simple PHP helper class for working with bulk sets of data which needs to be imported in the database., (*2)

Installing

The easiest way to install PdoBulk is to use Composer, the awesome dependency manager for PHP. Once Composer is installed, run composer.phar require nextpertise/pdo-bulk:dev-master and composer will do all the hard work for you., (*3)

Usage

If you are using the autoloader in Composer (or your framework ties into it), then all you need to do is add a use PdoBulk\PdoBulk; statement at the top of each file you wish to use PdoBulk in and use it like a normal class:, (*4)

<?php
namespace exampleApp;

require 'src/PdoBulk/PdoBulk.php';

use PdoBulk\PdoBulk;
use PdoBulk\PdoBulkSubquery;

// configuration
$dbhost     = "localhost";
$dbname     = "dpkg";
$dbuser     = "user";
$dbpass     = "password";

// database connection
$conn = new \PDO("mysql:host=$dbhost;dbname=$dbname",$dbuser,$dbpass);
$pdoBulk = new PdoBulk($conn);

Add a two entries, (*5)


// Add entry 1 into `Package` $packageEntry = array(); $packageEntry['name'] = 'wget'; $packageEntry['description'] = 'retrieves files from the web'; $packageEntry['architecture'] = 'amd64'; $pdoBulk->persist('Package', $packageEntry); // Add entry 2 into `Package` $packageEntry = array(); $packageEntry['name'] = 'curl'; $packageEntry['description'] = 'retrieves files from the web'; $packageEntry['architecture'] = 'amd64'; $pdoBulk->persist('Package', $packageEntry); // Flush records to the database $pdoBulk->flushQueue('Package');

The Versions

01/03 2015

dev-master

9999999-dev https://github.com/nextpertise/pdobulk

A PHP Pdo insert wrapper which allows you to bulk insert records wich contain subqueries.

  Sources   Download

GPL

by Teun Ouwehand

pdo mysql bulk multi

01/03 2015

dev-scrutinizer-patch-3

dev-scrutinizer-patch-3 https://github.com/nextpertise/pdobulk

A PHP Pdo insert wrapper which allows you to bulk insert records wich contain subqueries.

  Sources   Download

GPL

by Teun Ouwehand

pdo mysql bulk multi

01/03 2015

dev-scrutinizer-patch-2

dev-scrutinizer-patch-2 https://github.com/nextpertise/pdobulk

A PHP Pdo insert wrapper which allows you to bulk insert records wich contain subqueries.

  Sources   Download

GPL

by Teun Ouwehand

pdo mysql bulk multi