This is my code
<?php
Id =$_GET['ID'];
error_reporting(0);
$con = mysql_connect("localhost","root","");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("ehealth monitoring", $con);
$sth = mysql_query("SELECT DateandTime,BP FROM table WHERE ID='".$Id."'");
$rows = array();
$rows['name'] = 'BP';
while($r = mysql_fetch_array($sth)) {
$rows['data'][] = [$r['DateandTime'],$r[eval('BP')]];
}
echo json_encode($rows, JSON_NUMERIC_CHECK);
mysql_close($con);
?>
In this code BP contains 100/77, 100/50, 99/45 kind of values. I want convert this values as decimal. I can't find my mistake. please help me to convert the values and pass value to json.