Skip to content

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

License

Notifications You must be signed in to change notification settings

systemico/conector-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"));    

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages