Skip to content

ArchitectNate/ConnectionManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConnectionManager

A PHP singleton designed to keep track of multiple database connections.

Installation

The recommended way to install ConnectionManager is through composer(https://getcomposer.org/). Type the following command in your shell environment:

php ~/composer.phar require thephpeffect/connection-manager

Usage

The "default" connection can be accessed by the db() function without passing a connection name.

db("default", new mysqli(...));
db("stats", new PDO(...));

$result = db()->query("SELECT * FROM table1");
$statement = db("stats")->prepare("SELECT * FROM table1 WHERE a=? AND b=?");

About

A simple database connection manager

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages