Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of L Bharti  >  Query To JSON  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: Query To JSON
Convert MySQL query results to JSON format
Author: By
Last change: Coding error
Date: 6 years ago
Size: 368 bytes
 

Contents

Class file image Download
<?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");
?>