Firstly, please take a look this JSON http://ws.luyencong.net/data/search/query.php?do=json
Here is it's code:
/* --- Execute query and get the data. --- */
$query = $db->query("SELECT t.* FROM ".TABLE_PREFIX."threads t");
while($data = $db->fetch_array($query))
{
$results[] = array($data['subject'] => $data['subject']);
$json = json_encode($results, JSON_FORCE_OBJECT);
}
/* --- Print the results to the screen, for future purposes. --- */
echo $json;
But I want the output JSON format will look like this: http://ws.luyencong.net/data/search/json.txt
Help will be appreciated. Thanks for anything.
Have a good day!