2017 © Pedro Peláez
 

php-libraries o2db

PHP Data Objects (PDO) Wrapper

image

o2system/o2db

PHP Data Objects (PDO) Wrapper

  • Wednesday, March 30, 2016
  • by circlecreative
  • Repository
  • 2 Watchers
  • 1 Stars
  • 18 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

O2DB

O2DB is an Open Source PHP Database Library (PDO Class Wrapper). O2DB a PDO Class wrapper that equipped with SQL Query Builder is quite powerful. O2DB also the future will be equipped with SQL Forge, Schema Builder and Utilities to be quite powerful as well. Another amazing product from , released under MIT License. O2DB is build for working more powerfull with O2System Framework, but also can be used for integrated with others as standalone version with limited features., (*1)

Installation

The best way to install O2DB is to use [Composer][8], (*2)

composer require o2system/o2db

Usage

// Initialize DB
$DB = new DB(array(
    'driver'              => 'mysql',
    'dsn'                 => '',
    'hostname'            => 'localhost',
    'port'                => 3306,
    'username'            => 'root',
    'password'            => 'mysql',
    'database'            => 'database_name',
    'charset'             => 'utf8',
    'collate'             => 'utf8_general_ci',
    'prefix'              => '',
    'strict_on'           => FALSE,
    'encrypt'             => FALSE,
    'compress'            => FALSE,
    'buffered'            => FALSE,
    'persistent'          => TRUE,
    'transaction_enabled' => TRUE,
    'debug_enabled'       => TRUE,
    'options'             => array(
        PDO::ATTR_CASE              => PDO::CASE_NATURAL,
        PDO::ATTR_ERRMODE           => PDO::ERRMODE_EXCEPTION,
        PDO::ATTR_ORACLE_NULLS      => PDO::NULL_NATURAL,
        PDO::ATTR_STRINGIFY_FETCHES => FALSE,
        PDO::ATTR_EMULATE_PREPARES  => FALSE
    )
  )
));

// Using DSN for MySQL
$DB = new DB('mysql://username:password@127.0.0.1/database_name');

// Using DSN for SQLite
$DB = new DB('sqlite://username:password/c:\xampp\htdocs\o2db\database\data.db');

// Create a query
$result = $DB->get_where('table_name', ['record_status' => 1]);

if($result->num_rows() > 0)
{
  foreach($result as $row)
  {
    // you can call the row column like an array or an object
    echo $row->column_name;
    echo $row['column_name'];
  }
}

// Chaining Query Building
$query = $DB->select('
            tablename.name AS people_name
         ')->from('tablename')->where('record_status', 1)->order_by('record_ordering', 'ASC')->limit(10)->get();

If you familiar with CodeIgniter Active Record, O2DB has almost the same syntax. More details at the Wiki. (Coming Soon), (*3)

Ideas and Suggestions

Please kindly mail us at developer@circle-creative.com or steeven@circle-creative.com., (*4)

Bugs and Issues

Please kindly submit your issues at Github so we can track all the issues along development., (*5)

System Requirements

  • PHP 5.4+
  • Composer
  • PDO

Credits

The Versions

30/03 2016

dev-master

9999999-dev

PHP Data Objects (PDO) Wrapper

  Sources   Download

MIT

The Requires

 

by Aradea

database framework php pdo driver utilities libraries

30/03 2016

v2.0.0

2.0.0.0

PHP Data Objects (PDO) Wrapper

  Sources   Download

MIT

The Requires

 

by Aradea

database framework php pdo driver utilities libraries

30/03 2016

dev-2.0.0-dev

dev-2.0.0-dev

PHP Data Objects (PDO) Wrapper

  Sources   Download

MIT

The Requires

 

by Aradea

database framework php pdo driver utilities libraries

09/12 2015

1.0.0

1.0.0.0

PHP Data Objects (PDO) Wrapper

  Sources   Download

MIT

The Requires

 

by Aradea

database framework php pdo driver utilities libraries