| Recommend this page to a friend! |
| Info | Example | Reputation | Support forum | Blog | Links |
| Ratings | Unique User Downloads | Download Rankings | ||||
| Total: 191 | All time: 8,583 This week: 68 | |||||
| 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 !!!
| File | Role | Description |
|---|---|---|
| Data | Auxiliary data | |
| Class | Class source | |
| Example | Example script | |
| Lic. | License | |
| Class | Class source | |
| Test | Unit test script | |
| 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. |
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% |
|
|
| User Ratings | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||
| Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.