hi , I need help again at node red , I have this string at msg.payload (receive from data base as json)
"{"id":"2","sensor":"DHT11","value1":"26.20","location":"Office"}{"id":"3","sensor":"DHT11","value1":"26.10","location":"Office"}{"id":"4","sensor":"DHT11","value1":"25.60","location":"Office"}{"id":"5","sensor":"DHT11","value1":"25.50","location":"Office"}{"id":"6","sensor":"DHT11","value1":"25.50","location":"Office"}{"id":"7","sensor":"DHT11","value1":"25.40","location":"Office"}{"id":"8","sensor":"DHT11","value1":"25.40","location":"Office"}{"id":"9","sensor":"DHT11","value1":"25.40","location":"Office"}{"id":"10","sensor":"DHT11","value1":"25.30","location":"Office"}{"id":"11","sensor":"DHT11","value1":"25.20","location":"Office"}{"id":"12","sensor":"DHT11","value1":"25.30","location":"Office"}{"id":"13","sensor":"DHT11","value1":"25.10","location":"Office"}{"id":"14","sensor":"DHT11","value1":"25.10","location":"Office"}{"id":"15","sensor":"DHT11","value1":"25.10","location":"Office"}{"id":"16","sensor":"DHT11","value1":"25.10","location":"Office"}"
now i want show them at dashboard with table , for that i tried to parse them to jason format
but i get : SyntaxError: Unexpected token { in JSON at position 64 node red
php code for fetch is
$sql = mysqli_query($conn , "SELECT `id`,`sensor`, `value1`,`location` FROM `sensor_data` WHERE `location`='Office' ");
while($data = mysqli_fetch_row($sql)){
$id = $data[0];
$sensor = $data[1];
$value1 = $data[2];
$location= $data[3];
$data = array('id' => $id, 'sensor' => $sensor, 'value1' => $value1 ,'location' => $location );
$json = json_encode( $data );
echo $json;
}