Recommend this page to a friend! |
Download |
Info | Example | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not enough user ratings | Total: 190 | All time: 8,593 This week: 67 |
Version | License | PHP version | Categories | |||
yorch-mydb 1.0.2 | Custom (specified... | 5 | PHP 5, Databases |
Description | Author | |||||||||||||||||||||||
This package can execute queries on MySQL, SQLServer, PostgreSQL and ODBC. |
|
<?php |
Abstract Class to manage RDBMS (MySQL, MSSQLServer, ODBC, PostgreSQL) connections
Execute phpdoc -d MyDb/
Create file composer.json
{
"require": {
"yorch/mydb": "dev-master"
}
}
Execute composer.phar install
// 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;
The SQL Server connection only works in MS Windows.
For PostgreSQL the parameters in SQL Query must be $#. example: 'SELECT * FROM MYTABLE WHERE ID = $1 AND DESCRIPTION = $2'
For ODBC connection, if the query insert uses ? parameters throw this error (COUNT field incorrect or syntax error).
Sorry, my english is bad :(.
http://es.wikipedia.org/wiki/Patr%C3%B3n_de_dise%C3%B1o
http://es.wikipedia.org/wiki/Singleton
http://es.wikipedia.org/wiki/Abstract_Factory
P.D. Let's go play !!!
Files (7) |
File | Role | Description |
---|---|---|
composer.json | Data | Auxiliary data |
DriverDb.class.php | Class | Class source |
examples.php | Example | Example script |
LICENSE | Lic. | License |
MyDb.class.php | Class | Class source |
MyDbTest.php | Test | Unit test script |
README.md | Doc. | Documentation |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.