need help on how to send data to phpmyadmin using nodemcu and infrared sensor

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266HTTPClient.h>

#define IR1 D1
#define IR2 D2
#define IR3 D5
#define IR4 D7
bool ir,ir1,ir2,ir3;
int LED = 16;

const char* ssid = “Pixel_8551”; //id wifi
const char* password = “nakpasswordjatahu”; // password wifi

const char* host =“10.212.73.185”; // host wifi example

void setup() {
// put your setup code here, to run once:
pinMode(LED,OUTPUT);
pinMode(IR1,INPUT);
pinMode(IR2,INPUT);
pinMode(IR3,INPUT);
pinMode(IR4,INPUT);

Serial.begin(9600);
Serial.println();

WiFi.begin(ssid,password);

Serial.print(“Connecting”);
//wait for connection
while (WiFi.status() !=WL_CONNECTED)
{
delay(250);
Serial.print(".");
}

Serial.println("");
Serial.println("WiFi connected , IP address: ");
Serial.println(WiFi.localIP());
}

void loop()
{
// put your main code here, to run repeatedly:
HTTPClient http; //Declare object of class HTTPClient
String part,postData;

ir = digitalRead(IR1);
ir1 =digitalRead(IR2);
ir2 =digitalRead(IR3);
ir3 =digitalRead(IR4);
if (ir == 0 || ir1 == 0)
{
digitalWrite(LED, HIGH);
part = Serial.println(“Section A”);
//delay(1000);
}
else if (ir2 == 0 || ir3 == 0)
{
digitalWrite(LED, HIGH);
part = Serial.println(“Section B”);
//delay(1000);
}
else
{digitalWrite(LED, LOW);}

//post data
postData = “section=” + part;

http.begin(“http://10.20.73.185/fypBallOut1/insertDB.php”);
http.addHeader(“Content-Type”, “application/x-www-form-urlencoded”);

int httpCode = http.POST(postData); //Send the request
String payload = http.getString(); // Get the response payload

//Serial.println(“value=” + value);
Serial.println(httpCode); //Print HTTP return code
Serial.println(payload); //Print request response payload
Serial.println(“Section=” + part);

http.end(); //close connection

delay(1000); //delay 1 seconds
}

the data on serial monitor cannot being send to phpmyadmin. i hope somebody can help me

the data on serial monitor cannot being send to phpmyadmin.

Of course not. The phpmyadmin script is used to create, manage, delete, and view databases. It is NOT intended to be used in GET requests.

Are you running Apache on the server? If so, what do the logs tell you is happening when the Arduino makes the GET request?

i running xampp it get -1 result

I see the 'question' being, 'how do I get my ESP data to my website'.

I'll mention 3 ways, you'll have to do your own research and go your own route.

A) Turn the esp into its own web sever, on your local network, and have it do the thing.
B) ESP -> MQTT -> yourSite_dB
C) Web sockets.

I recommend using a RPi as your MQTT broker, for the ESP, to send the thing to your web site and keeps the ESP local. On the RPi, use Python, to transfer the MQTT data to your sites dB.

I went with using AWS IoT. Not fricking easy but I learned a whole bunch.