Skip to content

🐘 PHP class for connection to MySQL database using PDO

Notifications You must be signed in to change notification settings

erickfirmo/db.connection.php.pdo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DBConnection PDO

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>'
    
  ];

About

🐘 PHP class for connection to MySQL database using PDO

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages