https://github.com/mikeshiyan/lite-sql-insert
Lightweight SQL insertion service.
https://github.com/mikeshiyan/lite-sql-insert
composer insert lite oop pdo php sql
Last synced: about 1 year ago
JSON representation
Lightweight SQL insertion service.
- Host: GitHub
- URL: https://github.com/mikeshiyan/lite-sql-insert
- Owner: mikeshiyan
- License: mit
- Created: 2017-11-06T18:10:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-19T12:48:12.000Z (almost 8 years ago)
- Last Synced: 2025-01-11T01:07:41.651Z (about 1 year ago)
- Topics: composer, insert, lite, oop, pdo, php, sql
- Language: PHP
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lite SQL Insert
[](https://travis-ci.org/mikeshiyan/lite-sql-insert)
Very lightweight PHP service class for SQL INSERT queries abstraction.
Best suited for use as a [Composer](https://getcomposer.org) 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();
```