aidsoul/pdo
最新稳定版本:v1.2
Composer 安装命令:
composer require aidsoul/pdo
包简介
README 文档
README
PDO query builder
Installation
Installation with the command:
composer require aidsoul/pdo
Example Usage
require_once __DIR__ . '/vendor/autoload.php'; use Aidsoul\Pdo\Db; $host = 'localhost'; $dbName = 'test'; $user = 'root'; $pass = ''; $db = new Db("mysql:host={$host};dbname={$dbName}", $user, $pass); // SELECT $db->select() ->from('post') ->join('vkgroup')->on('group_id','id_group') ->orderBy(['id_post' =>'ASC']) ->limit(50) ->execute() ->fetchAll(); // INSERT $db->insert(['id_post','group_id']) ->into('post') ->values([66,28]) ->execute(); // DELETE $db->delete() ->from('post') ->where('group_id','=',113)->and('id_post','=',147) ->execute(); // UPDATE $db->update('vkgroup') ->set(['name'=>'test']) ->where('id_group','=',111) ->and('name','=','before the test') ->execute();
统计信息
- 总下载量: 104
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-01