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.
- Host: GitHub
- URL: https://github.com/systemico/conector-db
- Owner: systemico
- License: apache-2.0
- Created: 2020-04-26T15:04:20.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-03T21:06:24.000Z (almost 6 years ago)
- Last Synced: 2025-08-08T08:59:24.626Z (11 months ago)
- Language: PHP
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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"));