I have written a query on database the result is given in this form
Apples-100
Grapes-200
Oranges-50
Bananas-30
now i need to store the data in an array like this
[['Apples',100],['Grapes',200],['Oranges',50],['Bananas',30]]
how can I acheive this i tried this
while($row = mysql_fetch_assoc($getdatagraoh)){
$plotgraphs[] = array(
$row['Compliancestatus'],
$row['value']
);
}
header('ContentType: application/json; charset=utf-8');
$data= json_encode($plotgraphs);
I am not able to acheive that.Please help me in this regard.