troubleshooting Question

Put several query result in one JSON file using PHP

Avatar of thomaszhwang
thomaszhwangFlag for United States of America asked on
PHP
4 Comments1 Solution467 ViewsLast Modified:
I am using a PHP file to generate JSON files.  Now I have three queries.  I generate one JSON file for each of the queries.

I'm just wondering if it is possible to generate one JSON file for all three queries.

Following is the code I use to generate JSON files.  Thanks.

        $arr = array();
	$rs = mysql_query("
		SELECT
			Column
		FROM
			Table;
	");
	while($obj = mysql_fetch_object($rs)) {
		$arr[] = $obj;
	}
ASKER CERTIFIED SOLUTION
StingRaY

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros