I am trying to read data from database using esp32. I want to import the read value into a variable. How can I do that? Can you give an example?
Hello Hasan, unfortunately I don’t have an exact example, but did you read my previous answer?
In order to get a value to your ESP32, you should setup your PHP server to return your desired information when it receives an HTTP request from the ESP32.
- Here’s an example: https://randomnerdtutorials.com/esp32-http-get-post-arduino/
Basically, you can have a PHP script or Node-RED flow that answers an HTTP GET request to update an ESP32 variable.
I hope that helps!