Hi all,
I am having troubles sending decimal values to my mysql. All I get is normal values like 27 instead of 27.3.
from arduino I am sending these data via GET method
client.print( "GET /add.php?");
client.print("temp1=");
client.print( DHT.temperature, 1);
client.print("&&");
client.print("moi1=");
client.print(DHT.humidity, 1);
client.println( " HTTP/1.1");
client.println( "Host: 192.168.1.102" );
client.println( "Content-Type: application/x-www-form-urlencoded" );
client.println( "Connection: close" );
then on server side add.php consist of
$Sql="insert into dht (DateTime,teplota,vlhkost) values (NOW(),'".$_GET["temp1"]."', '".$_GET["moi1"]."')";
I think that the problem is right here
client.print("temp1=");
client.print( DHT.temperature, 1);
client.print("&&");
But don't know how to solve this.
I would rather use Json format but I dont know hot to do it.
I know only how to request data using ajax and json fromat from my web to arduino but I cant figure out ho to send json from arduino and then handle the data in php.
Thx for your help