https://github.com/shusaura85/mythdb
Simple database abstraction layer for PHP
https://github.com/shusaura85/mythdb
database database-abstraction-layer mysql php php-library postgresql sqlite3
Last synced: 4 months ago
JSON representation
Simple database abstraction layer for PHP
- Host: GitHub
- URL: https://github.com/shusaura85/mythdb
- Owner: shusaura85
- License: mit
- Created: 2024-10-03T14:18:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-04T15:30:17.000Z (over 1 year ago)
- Last Synced: 2025-04-17T11:35:33.206Z (about 1 year ago)
- Topics: database, database-abstraction-layer, mysql, php, php-library, postgresql, sqlite3
- Language: PHP
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
MythDB
=========
By Shu Saura
[MythDB](https://github.com/shusaura85/mythdb) is a simple database abstraction layer for PHP providing a consistent interface for multiple database drivers.
Supported databases
--------
* mySQL and MariaDB
* PostreSQL
* SQLite3
Installation
--------------------
* Using **Composer**
``` shell
composer require shusaura85/mythdb
```
* Manually
``` php
require '/path/to/src/autoload.php'
```
Usage
--------------------
``` php
require 'vendor/autoload.php'; // or '/path/to/src/autoload.php'
$db_driver = 'mysqli'; // available drivers: mysqli, pgsql, sqlite3
$db_persistent = false; // set to true to use a persistent connection
$db_utf8names = 'UTF8'; // if set, automatically calls query "SET NAMES ". not supported in sqlite
$db = new \MythDB\Database($db_driver, 'host', 'username', 'password', 'database', $db_persistent, $db_utf8names);
```
Requirements
-------------
MythDB requires at least `PHP 8.1` to work. MythDB only depends on the internal PHP modules for database connection (mysqli / postresql / sqlite3).
Licence
-------
MythDB is published under the MIT Licence, see `LICENSE` file for details.