leeqvip / database
PDO database library
Installs: 35 152
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 3
Open Issues: 0
Requires
- php: >=5.4.0
- ext-pdo: *
This package is auto-updated.
Last update: 2024-10-23 15:05:37 UTC
README
PDO database library for PHP.
the current supported databases are:
Installation
Use Composer
composer require leeqvip/database
Usage
require_once './vendor/autoload.php'; use Leeqvip\Database\Manager; $config = [ 'type' => 'mysql', // mysql,pgsql,sqlite,sqlsrv 'hostname' => '127.0.0.1', 'database' => 'test', 'username' => 'root', 'password' => 'abc-123', 'hostport' => '3306', ]; $manager = new Manager($config); $connection = $manager->getConnection(); $connection->query('SELECT * FROM `users` WHERE `id` = :id', ['id' => 1]); $connection->execute('UPDATE `users` SET `name` = "joker" where `id` = :id', ['id' => 1]);
License
This project is licensed under the Apache 2.0 license.