<?php
 
/*
 
 * Example to illustrate the use of the class
 
 */
 
//Include the file containing the class
 
include "queryToJson.class.php";
 
//perform a query
 
$result = mysql_query("select * from foo");
 
//create a new QueryToJson object
 
$jsonQuery = new QueryToJson;
 
//Use the function to get the JSON sring
 
$jsonObject = $jsonQuery->queryToJson($result, "foo");
 
?>
 
 |