mamadou-aly-sy/database-connection

A simple php database connection class

1.0.0 2021-11-09 13:52 UTC

This package is auto-updated.

Last update: 2022-05-31 11:00:29 UTC


README

A simple php Database connection class

Requirements

  • php >= 8.1
  • php-sqlite *

Installation

    composer require mamadou-aly-sy/database-connection

Usage

<?php

require_once './vendor/autoload.php';

// only the dsn is required if there is no username or password you dont need to specify them
$credentials = ['dsn' => 'sqlite:sqlite.db'];

$connection = new \MamadouAlySy\Connection($credentials);

// open a the connection
$connection->open(); // returns PDO instance