rezon73/pdo-vertica
最新稳定版本:2.4.4
Composer 安装命令:
composer require rezon73/pdo-vertica
包简介
Just another PDO database library special for Vertica
关键字:
README 文档
README
Just another PDO database library
Installation
Use Composer
$ composer require rezon73/pdo-vertica
Usage
Examples selecting, inserting, updating and deleting data from or into users table.
require_once 'vendor/autoload.php'; $dsn = 'mysql:host=your_db_host;dbname=your_db_name;charset=utf8'; $usr = 'your_db_username'; $pwd = 'your_db_password'; $pdo = new \Rezon73\PDOVertica\Database($dsn, $usr, $pwd); // SELECT * FROM users WHERE id = ? $selectStatement = $pdo->select() ->from('users') ->where('id', '=', 1234); $stmt = $selectStatement->execute(); $data = $stmt->fetch(); // INSERT INTO users ( id , usr , pwd ) VALUES ( ? , ? , ? ) $insertStatement = $pdo->insert(array( "id" =>1234, "usr" => "your_username", "pwd" => "your_password" )) ->into("users"); $insertStatement->execute(); // UPDATE users SET pwd = ? WHERE id = ? $updateStatement = $pdo->update(array("pwd" => "your_new_password")) ->table("users") ->where(new Clause\Conditional("id", "=", 1234)); $affectedRows = $updateStatement->execute(); // DELETE FROM users WHERE id = ? $deleteStatement = $pdo->delete() ->from("users") ->where(new Clause\Conditional("id", "=", 1234)); $affectedRows = $deleteStatement->execute();
The
sqlsrvextension will fail to connect when using error modePDO::ERRMODE_EXCEPTION(default). To connect, you will need to explicitly passarray(PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING)(orPDO::ERRMODE_SILENT) into the constructor, or override thegetDefaultOptions()method when usingsqlsrv.
Documentation
See DOCUMENTATION
Changelog
See CHANGELOG
License
See LICENSE
统计信息
- 总下载量: 1.49k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-07