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

This package is auto-updated.

Last update: 2024-05-04 22:44:52 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>'
    
  ];