Reputation: 626
im not sure how can i combine these two arrays together:
$query = mysql_query("SELECT * FROM table ORDER BY id");
$rows = array();
while($r = mysql_fetch_assoc($query)) {
$rows[] = $r;
}
$out = array("$r,'fruit'=> 'orange','location'=> 'home , 'test'=> 'off'");
As you can see i put all the mysql table data into an array called $rows[] and i have another array called $out
how can i combine this two so i can json encode them with this:
$result_string = json_encode($combined);
print $callback.'('.result_string.');';
Upvotes: 2
Views: 71