I have no trouble at all outputting MySQL data to an array then encoding in json.
What I am trying to understand is how can I add to this json output other pieces of non-dynamic data.
if (mysql_num_rows($result) > 0) {
while($obj = mysql_fetch_object($result)) {
$arr[] = $obj;
}
echo $_GET['callback'].'('.json_encode($arr).')';
}else{
}
What I need for example is to add something like
"firstnumber":"0"
"secondnumber":"10"
Is there a way to successfully add this form of data with the array of results and encode it all?
I would create an array with my other data, and then append it to the end: