项目作者: techoner

项目描述 :
PDO database library for PHP.
高级语言: PHP
项目地址: git://github.com/techoner/database.git
创建时间: 2018-10-16T15:28:01Z
项目社区:https://github.com/techoner/database

开源协议:Apache License 2.0

下载


Database library for PHP

PHPUnit
Coverage Status
Latest Stable Version
Total Downloads
License

PDO database library for PHP.

the current supported databases are:

type database
mysql MySQL
pgsql PostgreSQL
sqlite SQLite
sqlsrv SqlServer

Installation

Use Composer

  1. composer require leeqvip/database

Usage

  1. require_once './vendor/autoload.php';
  2. use Leeqvip\Database\Manager;
  3. $config = [
  4. 'type' => 'mysql', // mysql,pgsql,sqlite,sqlsrv
  5. 'hostname' => '127.0.0.1',
  6. 'database' => 'test',
  7. 'username' => 'root',
  8. 'password' => 'abc-123',
  9. 'hostport' => '3306',
  10. ];
  11. $manager = new Manager($config);
  12. $connection = $manager->getConnection();
  13. $connection->query('SELECT * FROM `users` WHERE `id` = :id', ['id' => 1]);
  14. $connection->execute('UPDATE `users` SET `name` = "joker" where `id` = :id', ['id' => 1]);

License

This project is licensed under the Apache 2.0 license.