PHP Classes
elePHPant
Icontem

PHP Database to File Download: Output database tables to JSON or XML using PDO

Recommend this page to a friend!
  Info   View files Documentation   View files View files (31)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-01-26 (2 years ago) RSS 2.0 feedNot enough user ratingsTotal: 360 All time: 6,747 This week: 351Up
Version License PHP version Categories
db2file 1.0.0MIT/X Consortium ...5.3XML, PHP 5, Databases, Files and Folders
Description Author

This package can output database tables to JSON or XML using PDO.

It can connect to a given supported database using PDO like Firebird, MySQL, Oracle, PostgreSQL, SQLite or Microsoft SQL Server.

The class executes a given query or a query to table to retrieve the records of a given table and generates either XML or JSON data from the table record data.

The generated XML or JSON is served for download as the output of the current script.

  Performance   Level  
Name: Natanael Simões <contact>
Classes: 3 packages by
Country: Brazil Brazil
Innovation award
Innovation award
Nominee: 1x

Winner: 1x

 

Details

DB2FILE

Retrieve data from database and generate/print JSON or XML file.

Installation

This library can be found on Packagist. We endorse that everything will work fine if you install this through composer.

Add in your composer.json:

{
    "require": {
        "natanaelsimoes/db2file": "1.0.0-beta"
    }
}

or in your bash:

$ composer require natanaelsimoes/db2file

Features

  • PSR-4 compliant for easy interoperability
  • Uses PDO to cover majority databases (Firebird, MySQL, Oracle, PostgreSQL, SQLite, Microsoft SQL Server)
  • Easy to add support for others PDO database drivers as needed
  • Gets and prints JSON/XML version of your tables and queries

See documentation docs/ for futher details about this library.

Usage

<?php
require 'vendor/autoload.php'
// Database configuration
$driver = DB2FILE\Converter::MySQL;
$dbname = 'information_schema';
$host = 'localhost';
$username = 'root';
$password = '123';
// Create converter
$converter = new DB2FILE\Converter($driver, $dbname, $host, $username, $password);
// Print the XML file in text/xml format
$converter->printXMLFromTable('ENGINES');
?>
  Files folder image Files  
File Role Description
Files folder imagedocs (16 files, 1 directory)
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License
Accessible without login Plain text file README.md Doc. Auxiliary data

  Files folder image Files  /  docs  
File Role Description
Files folder imageresources (11 files)
  Accessible without login HTML file 404.html Doc. Documentation
  Accessible without login HTML file class-Composer.Autoload.ClassLoader.html Doc. Documentation
  Accessible without login HTML file class-ComposerAuto...6df662d5817257.html Doc. Documentation
  Accessible without login HTML file class-DB2FILE.Converter.html Doc. Documentation
  Accessible without login Plain text file elementlist.js Data Auxiliary data
  Accessible without login HTML file function-Composer....ad.includeFile.html Doc. Documentation
  Accessible without login HTML file index.html Doc. Documentation
  Accessible without login HTML file namespace-Composer.Autoload.html Doc. Documentation
  Accessible without login HTML file namespace-Composer.html Doc. Documentation
  Accessible without login HTML file namespace-DB2FILE.html Doc. Documentation
  Accessible without login HTML file namespace-None.html Doc. Documentation
  Accessible without login HTML file source-class-Compo...ad.ClassLoader.html Doc. Documentation
  Accessible without login HTML file source-class-Compo...6df662d5817257.html Doc. Documentation
  Accessible without login HTML file source-class-DB2FILE.Converter.html Doc. Documentation
  Accessible without login HTML file source-function-Co...ad.includeFile.html Doc. Documentation
  Accessible without login HTML file tree.html Doc. Documentation

  Files folder image Files  /  docs  /  resources  
File Role Description
  Accessible without login Image file collapsed.png Icon Icon image
  Accessible without login Plain text file combined.js Data Auxiliary data
  Accessible without login Image file footer.png Data Auxiliary data
  Accessible without login Image file inherit.png Icon Icon image
  Accessible without login Image file resize.png Icon Icon image
  Accessible without login Image file sort.png Icon Icon image
  Accessible without login Plain text file style.css Data Auxiliary data
  Accessible without login Image file tree-cleaner.png Icon Icon image
  Accessible without login Image file tree-hasnext.png Icon Icon image
  Accessible without login Image file tree-last.png Data Auxiliary data
  Accessible without login Image file tree-vertical.png Icon Icon image

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

 Version Control Unique User Downloads Download Rankings  
 100%
Total:360
This week:0
All time:6,747
This week:351Up