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 (2 months ago) RSS 2.0 feedStarStarStarStar 69%Total: 826 This week: 1All time: 4,183 This week: 571Up
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 is available for providing paid consulting. Contact Unay Santisteban .
Classes: 6 packages by
Country: Spain Spain
Age: 35
All time rank: 74216 in Spain Spain
Week rank: 4 Up1 in Spain Spain Up
Innovation award
Innovation award
Nominee: 3x

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:826
This week:1
All time:4,183
This week:571Up
 User Ratings  
 
 All time
Utility:90%StarStarStarStarStar
Consistency:80%StarStarStarStarStar
Documentation:83%StarStarStarStarStar
Examples:85%StarStarStarStarStar
Tests:-
Videos:-
Overall:69%StarStarStarStar
Rank:316