othercode/database
Composer 安装命令:
composer require othercode/database
包简介
Database access library
README 文档
README
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:
"require": { "othercode/database": "*" }
And run the following command:
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.
require_once "database/autoload.php".
Configuration
Now we have to create the instance and add a new connection to it.
$db = new OtherCode\Database\Database(); $db->addConnection(array( 'driver' => 'mysql', 'host' => 'localhost', 'dbname' => 'test', 'username' => 'username', 'password' => 'password' ));
统计信息
- 总下载量: 51
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-05-08