ARDUINO + PHP

Hello,

I m sending two values (heart rate and temperature) database into Apache Server like:

float temperature = 30.8;
float heart = 120;

client.println("get /arduino.php?temp=temperature&hr=heart");

And the values aren't sent. but like this i can but i want to send variable values:

client.println("get /arduino.php?temp=30.8&hr=120");

Help me thanks

For reference, split it between multiple print strings and terminate that sequence with a println.
To answer this question:

client.print("get /arduino.php?temp="); //print the constant string
client.print(temperature); //print the variable temperature's value, note the lack of quotation marks
client.print("&hr="); //print the constant string
client.println(heart); //finally send the variable heart's value and a newline, in order to submit the data

The OP's problem was that they were sending the request as a constant string, so what the server was getting was "get /arduino.php?temp=temperature&hr=heart"

I know I'm being picky here but shouldn't heart rate be an 8-bit int rather than a float? Resolution of 0.1bpm seems unnecessary and if it goes above 255 an alarm rather than a precise reading ought to suffice :wink: Same goes for values below zero.