A small PHP Data Objects extension class for database handling.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jose Quintana d7e9e3bb82 1.0.0 3 years ago
src 1.0.0 3 years ago
license.md Create license.md 4 years ago
readme.md MySQL by default 3 years ago

readme.md

MyDb

A small PHP Data Objects (PDO) extension class for database handling.

Usage

<?php

// MySQL

$options = array(
  "hostname"    => "localhost",
  "username"    => "usr",
  "password"    => "pwd",
  "dbname"      => "dbname"
);

$dbh = new MyDb($options);
$sql = "SELECT id, description FROM `mytable`";

$sth = $dbh->prepare($sql);
$sth->execute();
$data = $sth->fetchAll(PDO::FETCH_ASSOC);

Options

<?php

$options = array(
    "driver"  => "mysql"          // > default: mysql
  "hostname"  => "localhost"      // > default: localhost
      "port"  => 3306             // > default: 3306
  "username"  => "usr"
  "password"  => "pwd"
    "dbname"  => "dbname"
   "charset"  => "utf8"           // > default: utf8
   "options"  => array( [PDO options] )
);

License

MIT license

© 2016 José Luis Quintana