I have not included whole program because my problem(I think) is one line:- Gsm.println("AT+HTTPPARA=\"url\",\http://xx.xxx.xxx.xxx:230/data.php?value=temp"\""); This works, but my database displays 'temp' which to my mind is a float variable and therefore the database should display the numeral it represents. I have also tried:- char str; Sprintf(str,"AT+HTTPPARA=\"url\",....../data.php?value=%d,temp"\""); and /data.php?value=""+temp+""\""). These display as blank in my database . Any advice to solve this problem will be appreciated.
This works, but my database displays 'temp' which to my mind is a float variable
How can "temp" (the string literal is, in your code, between double quotes) be, in any way, interpreted as a float?
Any advice to solve this problem will be appreciated.
sprintf is the way to go, but you need to get the syntax correct AND the format specifier MUST match the variable type. %d is for integers. %f is not.
Now, the next problem you'll encounter is that the %f format specifier is not supported on the Arduino. So, you'll need to use dtostrf() to convert the float value to a string, and use the %s format specifier to embed the string representation of the float into the AT command.
On the other hand, there is NO reason to send the entire command in one call. Smart people would use two or more calls, and not waste memory on converting this to that and concatenating stuff unnecessarily.