Skip to content

Repository files navigation

Database library for PHP

PHPUnitCoverage StatusLatest Stable VersionTotal DownloadsLicense

PDO database library for PHP.

the current supported databases are:

typedatabase
mysqlMySQL
pgsqlPostgreSQL
sqliteSQLite
sqlsrvSqlServer

Installation

Use Composer

composer require leeqvip/database

Usage

require_once'./vendor/autoload.php';
useLeeqvip\Database\Manager;
$config = [
'type' => 'mysql', // mysql,pgsql,sqlite,sqlsrv'hostname' => '127.0.0.1',
'database' => 'test',
'username' => 'root',
'password' => 'abc-123',
'hostport' => '3306',
];
$manager = newManager($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.

About

PDO database library for PHP.

Topics

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages