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: 6 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 (8 months ago)
- Default Branch: main
- Last Pushed: 2024-10-03T15:02:26.000Z (8 months ago)
- Last Synced: 2024-11-30T10:46:38.320Z (6 months ago)
- Topics: database, database-abstraction-layer, mysql, php, php-library, postgresql, sqlite3
- Language: PHP
- Homepage:
- Size: 11.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
* SQLite3Installation
--------------------* 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 = 'UTF-8'; // 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.