erickfirmo / dbconnection
There is no license information available for the latest version (1.1.2) of this package.
PDO database library
1.1.2
2021-09-03 13:14 UTC
Requires
- php: >=7
Requires (Dev)
- phpunit/phpunit: ^5.0
This package is auto-updated.
Last update: 2025-03-05 00:23:02 UTC
README
PHP class for connection to MySQL database using PDO. Developed by Érick Firmo (BR) http://erickfirmo.dev
Requirements
- PHP >= 7
Install
To install with composer:
composer require erickfirmo/dbconnection
Usage
<?php // Require composer autoloader require __DIR__ . '/vendor/autoload.php'; // Connection to MySQL database using PDO $connection = (new \Connection())->getPDOConnection();
Database Settings
Return an array with the database settings:
<?php return [ 'host' => 'localhost', 'driver' => 'mysql', 'charset' => 'utf-8', 'database' => '<database_name>', 'user' => '<database_user>', 'password' => '<database_password>' ];