| Recommend this page to a friend! | 
|  Download | 
| Info | Screenshots |  Files |  Install with Composer |  Download | Reputation | Support forum | Blog | Links | 
| Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
| 2025-07-09 (-1 hours ago)  |     69% | Total: 829 | All time:  4,173 This week: 43  | |||||
| Version | License | PHP version | Categories | |||
| database-pdo-class 2.32 | GNU General Publi... | 5.3 | PHP 5, Databases | 
| Description | Author | |
| This class can run queries with PDO and get results in XML and JSON. | 
What is the best PHP database to xml class?
Output database results in XML
Light database abstraction layer (PDO)
Currently supported:
To install the package we only have to add the dependency to *composer.json* file:
"require": {
  "othercode/database": "*"
}
And run the following command:
composer update
Also we can use this library without Composer, we only have to include in our script the "database/autoload.php" file.
require_once "database/autoload.php".
Now we have to create the instance and add a new connection to it.
$db = new OtherCode\Database\Database();
$db->addConnection(array(
    'driver' => 'mysql',
    'host' => 'localhost',
    'dbname' => 'test',
    'username' => 'username',
    'password' => 'password'
));
| Screenshots (2) | ||
|  Files (24) | 
| File | Role | Description | ||
|---|---|---|---|---|
|  .github (1 file) | ||||
|  examples (2 files, 1 directory) | ||||
|  src (1 file, 3 directories) | ||||
|  tests (1 file) | ||||
|    .travis.yml | Data | Auxiliary data | ||
|    autoload.php | Aux. | Auxiliary script | ||
|    composer.json | Data | Auxiliary data | ||
|    LICENSE | Lic. | Licence | ||
|    phpunit.xml | Data | Auxiliary data | ||
|    README.md | Doc. | Readme | ||
|  Files (24) | / | examples | 
| File | Role | Description | ||
|---|---|---|---|---|
|  sql (3 files) | ||||
|    example.php | Example | Example script | ||
|    test.sqlite | Data | Auxiliary data | ||
|  Files (24) | / | examples | / | sql | 
| File | Role | Description | 
|---|---|---|
|    mysql.sql | Data | Auxiliary data | 
|    pgsql.sql | Data | Auxiliary data | 
|    sqlite.sql | Data | Auxiliary data | 
|  Files (24) | / | src | 
| File | Role | Description | ||
|---|---|---|---|---|
|  Connectors (4 files) | ||||
|  Exceptions (3 files) | ||||
|  Query (1 file) | ||||
|  Database.php | Class | Class source | ||
|  Files (24) | / | src | / | Connectors | 
| File | Role | Description | 
|---|---|---|
|  Connector.php | Class | Class source | 
|  MysqlConnector.php | Class | Class source | 
|  PostgresConnector.php | Class | Class source | 
|  SQLiteConnector.php | Class | Class source | 
|  Files (24) | / | src | / | Exceptions | 
| File | Role | Description | 
|---|---|---|
|  ConnectionException.php | Class | Class source | 
|  DatabaseException.php | Class | Class source | 
|  QueryException.php | Class | Class source | 
| 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 | Reuses | Unique User Downloads | Download Rankings | ||||||||||||||||
| 91% | 1 | 
 | 
 | 
| User Ratings | ||||||||||||||||||||||||||||||
| 
 | ||||||||||||||||||||||||||||||
| Applications that use this package | 
| Simple Framework (SlaveFramework) | 
 If you know an application of this package, send a message to the author to add a link here.
 If you know an application of this package, send a message to the author to add a link here.
| Other classes that need this package | 
| Class | Why it is needed | Dependency | 
|---|---|---|
| Simple Framework | The Simple Framework uses this class as the abstract layer to access to database | Required | 
| Related pages | 
| GitHub page | 
| Complete information for Database PDO Class | 
| Documentation |