Skip to content

thewinterwind/simple-pdo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SimplePDO

Simple wrapper around PDO

###Installation

  • Require it into your composer.json
  • "anthonyvipond/simplePdo": "dev-master"
  • composer install

###Configuration

  • Pass in a configuration array
// Laravel style
$dbCreds = [
    'host'      => 'localhost',
    'driver'    => 'mysql',
    'database'  => 'db_name',
    'username'  => 'root',
    'password'  => 'secret',
    'charset'   => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix'    => '',
];

new SimplePdo($dbCreds);

###Usage

$pdo = new SimplePdo($dbCreds);

$pdo->statement('CREATE TABLE users');

$pdo->select('* FROM users')->fetch(); // returns the result object

$pdo->getTotalRows($table);

$pdo->createCompositeIndex($table, $columns)

Check out simplePdo.php to find all the methods!

About

Simple wrapper around PDO

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages