An open API service indexing awesome lists of open source software.

https://github.com/systemico/conector-db

Singleton pattern to connect database Mysql, PostgerSQL, Oracle, SQL Server, and others.
https://github.com/systemico/conector-db

Last synced: 6 months ago
JSON representation

Singleton pattern to connect database Mysql, PostgerSQL, Oracle, SQL Server, and others.

Awesome Lists containing this project

README

          

# conector-db
Singleton pattern to connect database Mysql, Postgrs, Oracle, SQL Server, and others.

# Settings.php example

class Settings{
public static $DB_HOST="";
public static $DB_USER="";
public static $DB_PASSWORD="";
public static $DB_NAME="";
}


#Connect example

Example to run a new Database connection.

require_once dirname(__FILE__)."/../vendor/autoload.php";
require_once dirname(__FILE__)."/Settings.php";
use conector_db\ConectorDB;
$conector= ConectorDB::get_conector(Settings::$DB_HOST,Settings::$DB_USER, Settings::$DB_PASSWORD, Settings::$DB_NAME);
print_r($conector->select("show tables"));