Download .zip |
Info | Example | View files (7) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2017-10-12 (16 hours ago) | Not enough user ratings | Total: 162 This week: 12 | All time: 8,322 This week: 76 |
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. |
|
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 |
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 |
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.