Login   Register  
PHP Classes
elePHPant
Icontem

File: documentation.txt

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Luke Szanto  >  MySQL 2 JSON  >  documentation.txt  >  Download  
File: documentation.txt
Role: Documentation
Content type: text/plain
Description: Simple documentation
Class: MySQL 2 JSON
Generate JSON output from MySQL query results
Author: By
Last change: The class now requires you to pass a query string rather than a query result.
Date: 2009-05-02 01:06
Size: 1,154 bytes
 

Contents

Class file image Download
/*/ ---- UPDATE ---- //

mysql_to_json now executes the query inside of the class so you simply pass the query string to the class when
you set the query. Please make sure you have filtered the query strings before hand to protect yourself from 
injection as this class has no such features at this current time.

// ---- Update ---- /*/

Using mysql 2 json will hopefully be a simple and easy process for you.

Mysql 2 json will enable you to convert your mysql database queries into json data on the fly, a simple process is described below.

1) Include the mysql_to_json class
2) Set up database and pass a query string to the class
3) Create a new instance of mysql_to_json and either pass this to the new instance
4) Set a callback function(optional)
5) Use $object->get_json(); to generate your json(where $object is your class file)

Mysql 2 json also supports creating a blank instance of the class if the user wants to method chain or use it in other methods. 
This is to make the script versatile and easy to use however you program.

If you have any issues or questions please feel free to email me at luke.found@gmail.com