torres-developer/pdo
Composer 安装命令:
composer require torres-developer/pdo
包简介
PDO wrapper API
关键字:
README 文档
README
An Wrapper API for the PHP PDO.
Basic Usage:
<?php require __DIR__ ."/../vendor/autoload.php"; $dbh = new \TorresDeveloper\PdoWrapperAPI\mysqlConnection( new Core\PDODataSourceName([ "host" => "192.168.1.40", "database" => "exampleDatabase", ], Core\Credentials::getCredentials( "user", "passwd" )) ); /* * Use the CRUD interface for easy operations: * - select; * - insert; * - update; * - delete. */ // get all from all users $dbh->select("user")->fetchAll(PDO::FETCH_OBJ); // get all users `id` $dbh->select("id", "user")->fetchAll(PDO::FETCH_OBJ); // get all users `name` and `age` $dbh->select(["name", "age"], "user")->fetchAll(PDO::FETCH_OBJ); // insert new users $users = [ ["id" => 123, "name" => "asdfs"], ["age" => 2], ["id" => null, "text" => "y7tgebh"] ]; $dbh->insert("user", ...$users); /* * You can use a query builder for more complex operations: */ $dbh->getBuider()->select() ->from("user") ->limit(5) ->run() ->fetchAll(\PDO::FETCH_OBJ)
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: AGPL-3.0-or-later
- 更新时间: 2022-10-16