php-pdo-chainer

所属分类:数值算法/人工智能
开发工具:PHP
文件大小:5KB
下载次数:0
上传日期:2015-11-15 17:06:15
上 传 者sh-1993
说明:  php-pdo链接器,pdo链包装器
(PDO chain wrapper ,)

文件列表:
LICENSE (1101, 2015-11-16)
composer.json (453, 2015-11-16)
src (0, 2015-11-16)
src\PDOChainer (0, 2015-11-16)
src\PDOChainer\DBAL.php (4902, 2015-11-16)
src\PDOChainer\PDOChainer.php (4548, 2015-11-16)

PHP PDO wrappers =========================================== 1. PDOChainer — low level DataBase manipulation class. 2. DBAL — DB layer over PDOChainer. PDOChainer usage example -------- ```php 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 -------- ```php 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); ```

近期下载者

相关文件


收藏者