database component

Maintainers

Details

github.com/heropoo/db

Source

Installs: 220

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 1

pkg:composer/heropoo/db

v0.5 2020-01-07 10:19 UTC

This package is auto-updated.

Last update: 2025-09-22 23:53:44 UTC


README

A database connection based on pdo

<?php

// get a connection

$config = [
    'dsn'=>'mysql:host=localhost;dbname=test',
    'username'=>'root',
    'password'=>'root'
];
$db = new Moon\Db\Connection($config);

//get pdo instance
try{
    $db->getPdo();
}catch (PDOException $e){
    echo $e->getMessage();
}