2017 © Pedro Peláez
 

library mydb

Abstract Class to manage RDBMS (MySQL, MSSQLServer, ODBC, PostgreSQL) connections

image

yorch/mydb

Abstract Class to manage RDBMS (MySQL, MSSQLServer, ODBC, PostgreSQL) connections

  • Thursday, October 12, 2017
  • by yorch
  • Repository
  • 2 Watchers
  • 0 Stars
  • 97 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

MyDb

Description

Abstract Class to manage RDBMS (MySQL, MSSQLServer, ODBC, PostgreSQL) connections, (*1)

Requirements

Developer Documentation

Execute phpdoc -d MyDb/, (*2)

Installation

Create file composer.json, (*3)

{ "require": { "yorch/mydb": "dev-master" } }, (*4)

Execute composer.phar install, (*5)

Example

// Mysql Example
$provider = 'MySQLDb';
$hostname = '';
$username = '';
$password = '';
$dbname   = '';

$dbMySQL = MyDb::getInstance($provider, $hostname, $username, $password, $dbname, 3306);  

$query = sprintf("SELECT 1 AS %s", $dbMySQL->escape($provider));

// Associate
print_r($dbMySQL->executeCommand($query));  

// Enumerate
print_r($dbMySQL->executeCommand($query, null, MyDb::ENUM));  

$dbMySQL = null;

Notes

The SQL Server connection only works in MS Windows., (*6)

For PostgreSQL the parameters in SQL Query must be $#. example: 'SELECT * FROM MYTABLE WHERE ID = $1 AND DESCRIPTION = $2', (*7)

For ODBC connection, if the query insert uses ? parameters throw this error (COUNT field incorrect or syntax error)., (*8)

Sorry, my english is bad :(., (*9)

References

http://es.wikipedia.org/wiki/Patr%C3%B3n_de_dise%C3%B1o, (*10)

http://es.wikipedia.org/wiki/Singleton, (*11)

http://es.wikipedia.org/wiki/Abstract_Factory, (*12)

Donate, (*13)

P.D. Let's go play !!!, (*14)

The Versions

12/10 2017

dev-master

9999999-dev https://github.com/yorch81/MyDb

Abstract Class to manage RDBMS (MySQL, MSSQLServer, ODBC, PostgreSQL) connections

  Sources   Download

Apache-2.0

The Requires

 

postgresql mysql odbc sql server abstract layer