duncan3dc/sql-class

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

1.9.1 2023-04-11 15:42 UTC

README

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/

Build Status Latest Version

Examples

The classes use a namespace of duncan3dc\SqlClass

use duncan3dc\SqlClass\Sql;
$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"],
])