https://github.com/othercodes/database
Light database abstraction layer (PDO)
https://github.com/othercodes/database
Last synced: about 1 year ago
JSON representation
Light database abstraction layer (PDO)
- Host: GitHub
- URL: https://github.com/othercodes/database
- Owner: othercodes
- License: mit
- Created: 2014-03-09T17:26:41.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2023-05-31T08:28:27.000Z (about 3 years ago)
- Last Synced: 2024-04-16T02:21:54.866Z (about 2 years ago)
- Language: PHP
- Homepage:
- Size: 82 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OtherCode Database
[](https://travis-ci.org/othercodes/database) [](https://packagist.org/packages/othercode/database) [](https://packagist.org/packages/othercode/database) [](https://packagist.org/packages/othercode/database)
Light database abstraction layer (PDO)
Currently supported:
* MySQL
* SQLite
* Postgres
## Installation
To install the package we only have to add the dependency to ***composer.json*** file:
```javascript
"require": {
"othercode/database": "*"
}
```
And run the following command:
```bash
composer update
```
### Install without Composer
Also we can use this library without Composer, we only have to include in our script the **"database/autoload.php"** file.
```php
require_once "database/autoload.php".
```
## Configuration
Now we have to create the instance and add a new connection to it.
```php
$db = new OtherCode\Database\Database();
$db->addConnection(array(
'driver' => 'mysql',
'host' => 'localhost',
'dbname' => 'test',
'username' => 'username',
'password' => 'password'
));
```