myjw3b/php-pdo-chainer
最新稳定版本:1.0.1
Composer 安装命令:
composer require myjw3b/php-pdo-chainer
包简介
PHP PDO wrapper
README 文档
README
- PDOChainer — low level DataBase manipulation class.
- DBAL — DB layer over PDOChainer.
PDOChainer usage example
use \PDOChainer\PDOChainer; $params = array('host'=>'127.0.0.1', 'dbname'=>'test', 'user'=>'root', 'pass'=>''); $db = new PDOChainer($params); // Fetch all rows $result = $db->query("SELECT * FROM `table`") ->fetchAll(PDO::FETCH_NUM); // Fetch first row $row = $db->prepare("SELECT * FROM `table` WHERE `id` = :id") ->bindValue(':id', 1, PDO::PARAM_INT) ->execute() ->fetch(PDO::FETCH_ASSOC);
DBAL usage example
use \PDOChainer\PDOChainer; use \PDOChainer\DBAL; $params = array('host'=>'127.0.0.1', 'dbname'=>'test', 'user'=>'root', 'pass'=>''); $dbal = new DBAL(new PDOChainer($params)); $table = 'users'; // Insert $data = array( array('id', 2), array('name', 'James'), ); $dbal->insert($table, $data); // Update $data = array( array('name', 'James'), ); $where = array( array('id', 2), ); $dbal->update($table, $data, $where);
统计信息
- 总下载量: 34
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-20