I want to represent my SQL data in graph using react native and PHP ,I tried many times but I could not do it with dynamic data.
This is my php file that fetch my data:
<?php
$serverName="DESKTOP-T5SLVUB\SQL2008R2";
$connectionInfo=array("Database"=>"Netos_DB","UID"=>"sa","PWD"=>"123");
$conn=sqlsrv_connect($serverName,$connectionInfo);
$sql = "select ChiffreAffaire from V502_client where Mois=2 and Annee=2020 ";
$stmt = sqlsrv_query( $conn, $sql );
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ){
$Item = $row;
$json = json_encode($Item); echo $json;
}
?>
The output of this file:
{"ChiffreAffaire":"4800.00"}{"ChiffreAffaire":"12000.00"}