Login   Register  
PHP Classes

MySQL to JSON: Convert data from MySQL query results into JSON

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

  Author Author  
Picture of Adnan Siddiqi
Name: Adnan Siddiqi is available for providing paid consulting. Contact Adnan Siddiqi .
Packages: 1 Browse all classes by Adnan Siddiqi Browse all classes by
Country: Pakistan Pakistan - PHP jobs in Pakistan
Age: 113
All time rank: 2443 in Pakistan Pakistan
Week rank: 232 Up5 in Pakistan Pakistan Down
Innovation award
Innovation award
Nominee: 1x

  Detailed description   Download Download .zip .tar.gz  
This class can be used to convert data from MySQL query results into a JavaScript expression in JavaScript Object Notation.

It takes a MySQL query result handle and retrieves the query result column names and the query result data.

The class generates the definition of a JavaScript object in JSON that contains an array of a rows of query result data.

Each array element represents an object with the properties set to the query result column names. The property values are the query results for the respective row and column.

  Classes of Adnan Siddiqi  >  MySQL to JSON  >  Download Download .zip .tar.gz  >  Support forum Support forum (4)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: MySQL to JSON
Base name: mysql2json
Description: Convert data from MySQL query results into JSON
Version: -
PHP version: -
License: The PHP License
All time users: 9064 users
All time rank: 150
Week users: 10 users
Week rank: 149 Up
  Groups   Freshmeat project   Rate classes User ratings  
  Trackback   Applications   Files Files  

Group folder image Databases Database management, accessing and searching View top rated classes

  Innovation Award  
PHP Programming Innovation award nominee
July 2006
Number 3
Since the raise of interest on the development AJAX based applications, JavaScript Object Notation (JSON) has became a relevant topic.

JSON is often used by Web server applications to serialize objects that are recreated on the browser side by Javascript code that handles AJAX based interactions.

A great part of the AJAX applications are database driven. Frequently, PHP applications retrieve data from MySQL databases to respond to AJAX requests.

This class helps implementing AJAX based PHP database driven applications with MySQL by serializing query results using JSON.

Manuel Lemos

  Freshmeat project  
Project record: mysql2json
Popularity score: 11.4
Vitality score: 53.39

  User ratings  
RatingsUtility Consistency Documentation Examples Tests Videos Overall Rank
All time: Sufficient (66.7%) Sufficient (75.0%) Sufficient (66.7%) Good (83.3%) - - Not sure (55.8%) 1167
Month: Not yet rated by the users

  Trackback links  
Link Description
links for 2006-12-24 Daily Links...
More PHP goodies Here’s a PHP basic authenticator class by David Wilkinson and a MYSQL recordset to JSON convertor by Adnan Siddiqi. Handy little things...
My class in Top 10 My class Mysql to JSON is ranked 8th this week in Top Downloaded Class section...
November 11, 2007 I have been tinkering with trying to get mysql directly into JSON.
PHP-Based MySQL-to-JSON Converter A new PHP component by Adnan Siddiqi accepts a MySQL result set and converts it into a JSON message...
PHP-Based MySQL-to-JSON Converter A new PHP component by Adnan Siddiqi accepts a MySQL result set and converts it into a JSON message...

  Applications that use this class  
No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.
  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example
Accessible without login Plain text file jsontest2.html Data HTML file parsing returned JSON data
Plain text file mysql2json.class.php Class Main Class File
Accessible without login Plain text file README.txt Doc. Help File

Download Download all files: mysql2json.tar.gz mysql2json.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.