Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/duncan3dc/sql-class

A simple database abstraction layer for PHP, with an on disk caching facility.
https://github.com/duncan3dc/sql-class

mysql odbc php sql

Last synced: 4 days ago
JSON representation

A simple database abstraction layer for PHP, with an on disk caching facility.

Awesome Lists containing this project

README

        

sql-class
=========

A simple database abstraction layer, with an on disk caching facility.

Full documentation is available at http://duncan3dc.github.io/sql-class/
PHPDoc API documentation is also available at [http://duncan3dc.github.io/sql-class/api/](http://duncan3dc.github.io/sql-class/api/namespaces/duncan3dc.SqlClass.html)

[![Build Status](https://github.com/duncan3dc/sql-class/workflows/.github/workflows/buildcheck.yml/badge.svg?branch=main)](https://github.com/duncan3dc/sql-class/actions/workflows/buildcheck.yml)
[![Latest Version](https://img.shields.io/packagist/v/duncan3dc/sql-class.svg)](https://packagist.org/packages/duncan3dc/sql-class)

Examples
--------

The classes use a namespace of duncan3dc\SqlClass
```php
use duncan3dc\SqlClass\Sql;
```

-------------------

```php
$sql = new Sql([
"mode" => "mysql",
"hostname" => "localhost",
"username" => "root",
"password" => "password",
]);

$row = $sql->select("table_1",[
"field1" => "one",
"field2" => "two",
]);

$sql->update("table_1",[
"field3" => "three",
],[
"field1" => $row["field1"],
"field2" => $row["field2"],
])
```