How to make arduino and wifi shield read data that only contain in database ?

hi i just newbie in using arduino and wifi shield
so here is my coding of how my wifi shield link to my databse
Just wanna know how to set validation data

My project works like this : after user input their phone number , the arduino will make a verification to make sure the phone number exist in databse… If the user phone number exist then the timer will start, if not, the timer will not start and user have to input their phone number again.

The main part is how to make the arduino n wifi shield read the validation data from database
Thanks

here the coding

#include <CytronWiFiShield.h>
#include <CytronWiFiClient.h>
#include <CytronWiFiServer.h>
#include <SoftwareSerial.h>

const char *ssid = “Infinix Zero 3”;
const char *pass = “muiz1998”;
IPAddress ip();
ESP8266Server server(80);

const char htmlHeader = “HTTP/1.1 200 OK\r\n”
“Content-Type: text/html\r\n”
“Connection: close\r\n\r\n”
“\r\n”
“\r\n”;

void setup() {

// put your setup code here, to run once:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}

if(!wifi.begin(2, 3))
{
Serial.println(F(“Error talking to shield”));
while(1);
}
Serial.println(wifi.firmwareVersion());
Serial.print(F("Mode: "));Serial.println(wifi.getMode());// 1- station mode, 2- softap mode, 3- both
// Uncomment these 2 lines if you are using static IP Address
// Serial.println(F(“Setup wifi config”));
// wifi.config(ip);
Serial.println(F(“Start wifi connection”));
if(!wifi.connectAP(ssid, pass))
{
Serial.println(F(“Error connecting to WiFi”));
while(1);
}
Serial.print(F("Connected to "));Serial.println(wifi.SSID());
Serial.println(F("IP address: "));
Serial.println(wifi.localIP());
wifi.updateStatus();
Serial.println(wifi.status()); //2- wifi connected with ip, 3- got connection with servers or clients, 4- disconnect with clients or servers, 5- no wifi
//clientTest();

//sendData();

//espblink(100);
//server.begin();
}

void loop() {
// put your main code here, to run repeatedly:
//serverTest();
sendData();
delay(5000);
}

void sendData(){
Serial.println(“Sending data to server”);
const char destServer = “”;
ESP8266Client client;
String iddevice = “number”;

//http://ip add/WASHINGMACHINEBARU/storedata.php?value1=test&value2=poli
if(client.connect(destServer, 80))
{
Serial.println(“CONNECTED”);
String data=“GET /WASHINGMACHINEBARU/storedata.php?”;
data+="&number=";
data+=iddevice;
data+=" HTTP/1.1\r\n";
data+=“Host: ip add\r\n”;
data+=“Connection: close\r\n\r\n”;

Serial.println(data);
Serial.println(client.print(data));
}else
{
Serial.println(“Not able to connect”);
}

}

writedatatoDB.ino (2.35 KB)

Hello,
Welcome to Arduino forums! :slight_smile:

Do you have experience with any of these:

  • *SQL
  • NoSQL such as MongoDB?
  const char destServer[] = "";
  ESP8266Client client;
String iddevice = "number";

    if(client.connect(destServer, 80))

You don't REALLY expect to connect to an unnamed server, do you?