Combining three mysql queries into one json array in php

json, mysql, php

Solution

You might want to look into `array_merge()`.

A simple example:

<?php
$result = array_merge($array_result_of_query1, $array_result_of_query2, $array_result_of_query3);
echo json_encode($result);
?>

Problem

I have a php script that has three queries that are each returning a set of results. Now i want to combine the results from the three queries into a single JSON array. Anyone knows how to achieve this? The queries can't be joined. Thanks.

Original source