PHP Classes

Database PDO Abstract Layer: Run queries with PDO and get results in XML, JSON

Recommend this page to a friend!
  Info   Screenshots Screenshots   View files View files (22)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (1 month ago) RSS 2.0 feedStarStarStarStar 68%Total: 825 All time: 4,182 This week: 113Up
Version License PHP version Categories
database-pdo-class 2.29GNU General Publi...5.3PHP 5, Databases
Description 

Author

This class can run queries with PDO and get results in XML and JSON.

It can connect to a given database using the PDO extension and retrieves the results into arrays, objects, XML documents, CSV files or JSON strings.

The class supports prepared queries, transactions, stored procedures, etc..

Picture of Unay Santisteban
  Performance   Level  
Name: Unay Santisteban <contact>
Classes: 5 packages by
Country: Spain Spain
Innovation award
Innovation award
Nominee: 2x

Recommendations

What is the best PHP database to xml class?
Output database results in XML

Details

OtherCode Database

Build Status Latest Stable Version License Total Downloads

Light database abstraction layer (PDO)

Currently supported:

  • MySQL
  • SQLite
  • Postgres

Installation

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

Install without Composer

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".

Configuration

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  
  • Example-result.png
  • Example.png
  Files folder image Files  
File Role Description
Files folder image.github (1 file)
Files folder imageexamples (2 files, 1 directory)
Files folder imagesrc (1 file, 3 directories)
Files folder imagetests (1 file)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file autoload.php Aux. Auxiliary script
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. Licence
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Readme

  Files folder image Files  /  .github  
File Role Description
  Accessible without login Plain text file dependabot.yml Data Auxiliary data

  Files folder image Files  /  examples  
File Role Description
Files folder imagesql (3 files)
  Accessible without login Plain text file example.php Example Example script
  Accessible without login Plain text file test.sqlite Data Auxiliary data

  Files folder image Files  /  examples  /  sql  
File Role Description
  Accessible without login Plain text file mysql.sql Data Auxiliary data
  Accessible without login Plain text file pgsql.sql Data Auxiliary data
  Accessible without login Plain text file sqlite.sql Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
Files folder imageConnectors (4 files)
Files folder imageExceptions (3 files)
Files folder imageQuery (1 file)
  Plain text file Database.php Class Class source

  Files folder image Files  /  src  /  Connectors  
File Role Description
  Plain text file Connector.php Class Class source
  Plain text file MysqlConnector.php Class Class source
  Plain text file PostgresConnector.php Class Class source
  Plain text file SQLiteConnector.php Class Class source

  Files folder image Files  /  src  /  Exceptions  
File Role Description
  Plain text file ConnectionException.php Class Class source
  Plain text file DatabaseException.php Class Class source
  Plain text file QueryException.php Class Class source

  Files folder image Files  /  src  /  Query  
File Role Description
  Plain text file Query.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file ConnectionTest.php Class Class source

 Version Control Reuses Unique User Downloads Download Rankings  
 91%1
Total:825
This week:0
All time:4,182
This week:113Up
 User Ratings  
 
 All time
Utility:100%StarStarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:-
Examples:93%StarStarStarStarStar
Tests:-
Videos:-
Overall:68%StarStarStarStar
Rank:451