mikeshiyan/lite-sql-insert

This package is abandoned and no longer maintained. The author suggests using the shiyan/lite-sql-insert package instead.

Lightweight SQL insertion service.

3.0.0 2018-04-27 20:15 UTC

This package is auto-updated.

Last update: 2022-02-01 13:10:54 UTC


README

Build Status

Very lightweight PHP service class for SQL INSERT queries abstraction.

Best suited for use as a Composer library.

Requirements

  • PHP >= 7.1
  • PDO extension

Installation

To add this library to your Composer project:

composer require shiyan/lite-sql-insert

Usage

$connection = new \Shiyan\LiteSqlInsert\Connection($pdo);
$insert = $connection->insert('my_table', ['name', 'value']);

foreach ($my_data as $name => $value) {
  $insert->values(['name' => $name, 'value' => $value]);
}

$insert->commit();