PHPackages                             jkga/dbcon - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. jkga/dbcon

ActiveLibrary[Database &amp; ORM](/categories/database)

jkga/dbcon
==========

A PHP API to connect to different RDBMS and NoSQL

214PHP

Since Mar 2Pushed 10y ago1 watchersCompare

[ Source](https://github.com/jkga/dbcon)[ Packagist](https://packagist.org/packages/jkga/dbcon)[ RSS](/packages/jkga-dbcon/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

dbcon
=====

[](#dbcon)

A PHP API to connect to different RDBMS and NoSQL ex. mysql, mysqli, postgresSQL, mongoDB etc..

Why would you need this
-----------------------

[](#why-would-you-need-this)

Under the hood, Dbcon uses **PDO** to connect to different supported database management system and **native** functions for those who have not. You would need these if you need to define multiple database connection on a single file and establish a connection later. It allows the application to connect to different database management system using a **wrapper** that can be used by other developer **easier** and **cleaner**

### Benefits

[](#benefits)

- cleaner code during development
- configure multiple **different** database connection
- easier to maintain
- modular (can define your own extension.Please see **Extending** section)

### Note

[](#note)

For small projects and simple application, use native functions to connect and manage your databases.It is advisable only to use dbcon for large projects in such maintainability and productivity are tedious tasks.

Requirements
------------

[](#requirements)

- PHP 5.4 (PHP 5.5+ recommended)
- PDO driver
- DBMS **driver** defined by developer's extended class

Currently supported DBMS
------------------------

[](#currently-supported-dbms)

- MySQL (PDO) / MySQLi (native)
- PostgreSQL (PDO)

How to use
----------

[](#how-to-use)

Download the zip file to your computer and extract to the root directory of your server. Below is an excerpt script from *example/mysql/mysql.example.php* file to connect to **MySQL**. Example database connection scripts are located in /example folder for your reference.

```
