Use a php file which simply outputs json data.  E.g.


//Get some data from a table
$my_array = array();
$result1 = @mysql_query("SELECT field1, field2 FROM table1 ORDER BY field1");
while ($row = @mysql_fetch_array($result1))
   $my_array[] = $row;

//Add it and some other data to an array
$data = array(
  "results" => array(
    "my_field1" => "abcd",
		"my_array" => "my_array",
    "my_manual_array" => array(
      "item" =>
          "item_field1" => "123456",
          "item_field2" => "Hello 1"
          "item_field1" => "7890",
          "item_field2" => "Hello 2"

//Output it as json
echo json_encode($data);


We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.


Your email address will not be published.