hypercode/queryrunner
Composer 安装命令:
composer require hypercode/queryrunner
包简介
A form to create and execute querys using PHP.
README 文档
README
Using the packages Query and DatabaseConnection, use the QueryRunner. A form to create and execute querys using PHP.
First step is set a database.
ConnectionManagement::setDatabase([ 'db' => [ "driver" => "psql", "host" => "localhost", "port" => "8080", "dbname" => "clients_db", "user" => "root", "password" => "1234", ] ]);
Now, you can use normally QueryRunner.
QueryRunner use the same form of Query from Hyper. First, you build query
$query = new QueryRunner; $query->select('TableName', 'name,age,created_by');
After that, you can use three methods to execute the query.
fetch
Execute query and return just the first result.
$query->select('TableName')->fetch();
fetchAll
Execute query and return all result inside of a array.
$query->select('TableName')->fetchAll();
execute
Execute query and return rows number affects.
$query->select('TableName')->execute();
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-01-03