<?php
mysql_pconnect("localhost","root","");
mysql_select_db("AppDevelopMenu") or die( '1');
$sql1=mysql_query("select Question from questions where QId ='1'");
if(!$sql1)
echo '2';
else{
$question=mysql_fetch_assoc($sql1) ;
$outputq[]=$question;
$sql=mysql_query("select OptionId,OptionContent from options where QId ='1'");
if(!$sql)
{
echo '3';
}
else {
while($row=mysql_fetch_assoc($sql))
$outputq[]=$row;
print(json_encode($outputq));
}
}
mysql_close();
?>
i have to modify this code to read json in a different structure that lets say question is the root node..QuestionContent and options are there on next level.And then options is the root node for option1,option2,option3 etc
How should I modify my php code to achieve this