Is there someone who can help me and show me how i can receive data for database to esp, because i need this date in arduino sketch. I can send data to database, and this is my code in php:
<?php
$wartosc1 = $_GET['temperatura'];
$wartosc = $_GET['wilgotnosc'];
$connect = mysqli_connect("localhost","root","szynszyle","food") or die("blad polaczenia z baza danych");
if($wartosc!='')
{
$dodaj=mysqli_query($connect,"INSERT INTO device_values (device_id,temp_level,humidity_level) VALUES ('100','$wartosc1','$wartosc')");
echo "<h1>THE DATA HAS BEEN SEND!!</h1>";
mysqli_close($connect);
}
?>
and from arduino ide:
String url = "http://localhost/food/conec.php?temperatura="+String(t)+"&wilgotnosc="+String(h);
Serial.print("Wysylam dane na serwer: ");
Serial.println(url);
client.print(String("GET ") + url + " HTTP/1.1\r\n" +
"Host: " + String(adresSerwera) + "\r\n" +
"Connection: close\r\n" +
"Content-Length: 0\r\n" +
"\r\n");
And this works fine, but how to receive date?I will be very grateful for help.