PHP Classes
elePHPant
Icontem

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 (21)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-05-15 (9 days ago) RSS 2.0 feedStarStarStarStar 68%Total: 738 This week: 3All time: 4,373 This week: 241Up
Version License PHP version Categories
database-pdo-class 2.17GNU 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..

Recommendations

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

  Performance   Level  
Name: Unay Santisteban is available for providing paid consulting. Contact Unay Santisteban .
Classes: 4 packages by
Country: Spain Spain
Age: 28
All time rank: 82718 in Spain Spain
Week rank: 76 Up5 in Spain Spain Up
Innovation award
Innovation award
Nominee: 1x

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 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  /  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:738
This week:3
All time:4,373
This week:241Up
 User Ratings  
 
 All time
Utility:100%StarStarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:-
Examples:93%StarStarStarStarStar
Tests:-
Videos:-
Overall:68%StarStarStarStar
Rank:512