Sending my data to database

HI again
So I connect two nodemce together by wire , and I got the data
now I want to send it to data base

this is my code for the nodemcu with RFID to send it to another node

#include <SPI.h>
#include <MFRC522.h>
#include <Wire.h>
#include <SoftwareSerial.h>
SoftwareSerial Serial2(13, 15);

#define SS_PIN 2
#define RST_PIN 0

String content = "";


MFRC522 mfrc522(SS_PIN, RST_PIN);



void setup() {


   Wire.begin();   
  Serial2.begin( 115200 );
  Serial.begin( 115200 ); 
  SPI.begin();  
  mfrc522.PCD_Init();
  Serial.println("Hello, Put your card");
   delay(2000);

}

void loop() {
 

 if ( ! mfrc522.PICC_IsNewCardPresent()) {
 return;
 }
 
 if ( ! mfrc522.PICC_ReadCardSerial()) {
 return;
 }

 
for (byte i = 0; i < mfrc522.uid.size; i++) {
       Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "); 
       Serial.print(mfrc522.uid.uidByte[i], HEX);
       Serial2.println(mfrc522.uid.uidByte[i], HEX);
    content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
    content.concat(String(mfrc522.uid.uidByte[i], HEX));
    
    }
   content.toUpperCase();
  Serial.println();
  
}

and this is my another code to resived from the first node to send it to database

#include <ESP8266WiFi.h>     
#include <WiFiClient.h> 
#include <ESP8266WebServer.h>
#include <ESP8266HTTPClient.h>
#include <SPI.h>
#include <SoftwareSerial.h>
SoftwareSerial Serial2 (13,15); 


const char *ssid = "ssid";  
const char *password = "My Pass";

//Web/Server address to read/write from 
const char *host = "192.168.1.00";   

String getData ,Link;
String CardID="";

void setup() {
  delay(1000);
  Serial.begin(115200);
  Serial2.begin( 115200 );
  SPI.begin();  

  WiFi.mode(WIFI_OFF);       
  delay(1000);
  WiFi.mode(WIFI_STA);        
  
  WiFi.begin(ssid, password);     
  Serial.println("");

 if(WiFi.status() != WL_CONNECTED){
    WiFi.disconnect();
    WiFi.mode(WIFI_STA);
    Serial.print("Connecting to ");
    Serial.println(ssid);
    WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
    Serial.println("");
    Serial.println("Connected");
    Serial.print("IP address: ");
    Serial.println(WiFi.localIP());  
  }}

void loop() {
  

   if (Serial2.available())
  { Serial.write (Serial2.readString()); 
  CardID = Serial2.read();
  
  
  
  HTTPClient http;    
  
  //GET Data
  getData = "?CardID=" + CardID;  //Note "?" added at front
  Link = "http://192.168.1.00/loginsystem/postdemo.php" + getData;
  
  http.begin(Link);
  
  int httpCode = http.GET();            
  delay(10);
  String payload = http.getString();   
  
  Serial.println(httpCode);  
  Serial.println(payload);    
  Serial.println(CardID);     
 
  CardID = "";
  getData = "";
  Link = "";
 http.end();   
  
  }}

so why the reading from the serial2 dosent send to database ?

HENDABED:
HI again
So I connect two nodemce together by wire , and I got the data
now I want to send it to data base

this is my code for the nodemcu with RFID to send it to another node

#include <SPI.h>

#include <MFRC522.h>
#include <Wire.h>
#include <SoftwareSerial.h>
SoftwareSerial Serial2(13, 15);

#define SS_PIN 2
#define RST_PIN 0

String content = "";

MFRC522 mfrc522(SS_PIN, RST_PIN);

void setup() {

Wire.begin(); 
  Serial2.begin( 115200 );
  Serial.begin( 115200 );
  SPI.begin(); 
  mfrc522.PCD_Init();
  Serial.println("Hello, Put your card");
  delay(2000);

}

void loop() {

if ( ! mfrc522.PICC_IsNewCardPresent()) {
return;
}

if ( ! mfrc522.PICC_ReadCardSerial()) {
return;
}

for (byte i = 0; i < mfrc522.uid.size; i++) {
      Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
      Serial.print(mfrc522.uid.uidByte[i], HEX);
      Serial2.println(mfrc522.uid.uidByte[i], HEX);
    content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
    content.concat(String(mfrc522.uid.uidByte[i], HEX));
   
    }
  content.toUpperCase();
  Serial.println();
 
}






and this is my another code to resived from the first node to send it to database 





#include <ESP8266WiFi.h>   
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266HTTPClient.h>
#include <SPI.h>
#include <SoftwareSerial.h>
SoftwareSerial Serial2 (13,15);

const char *ssid = "ssid"; 
const char *password = "My Pass";

//Web/Server address to read/write from
const char *host = "192.168.1.00";

String getData ,Link;
String CardID="";

void setup() {
  delay(1000);
  Serial.begin(115200);
  Serial2.begin( 115200 );
  SPI.begin();

WiFi.mode(WIFI_OFF);     
  delay(1000);
  WiFi.mode(WIFI_STA);       
 
  WiFi.begin(ssid, password);   
  Serial.println("");

if(WiFi.status() != WL_CONNECTED){
    WiFi.disconnect();
    WiFi.mode(WIFI_STA);
    Serial.print("Connecting to ");
    Serial.println(ssid);
    WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
    Serial.println("");
    Serial.println("Connected");
    Serial.print("IP address: ");
    Serial.println(WiFi.localIP()); 
  }}

void loop() {

if (Serial2.available())
  { Serial.write (Serial2.readString());
  CardID = Serial2.read();
 
 
 
  HTTPClient http;   
 
  //GET Data
  getData = "?CardID=" + CardID;  //Note "?" added at front
  Link = "http://192.168.1.00/loginsystem/postdemo.php" + getData;
 
  http.begin(Link);
 
  int httpCode = http.GET();           
  delay(10);
  String payload = http.getString(); 
 
  Serial.println(httpCode); 
  Serial.println(payload);   
  Serial.println(CardID);

CardID = "";
  getData = "";
  Link = "";
http.end(); 
 
  }}





so why the reading from the serial2 dosent send to database ?

It cant read the data from serial2 and send it to the database

void loop() {
  

   if (Serial2.available())
  { Serial.write (Serial2.readString()); 
  CardID = Serial2.read();
  ...

You read all the information using Serial2.readString() so there is nothing left to read and assign to CardID.
Try something like this:

   if (Serial2.available())
  {
    CardID = Serial2.readString();
   Serial.write (CardID); 
  ...
&⸮147203165

⸮⸮1292643

⸮9310619


⸮⸮35176121

C⸮117108237

This what I got , the first and second numbers shows "? "
doesnt read it correctly .
and when send it to the data base send it as 0.
So it deals with it as one tags
what the wrong

what the wrong

"the wrong" is that you changed your code and then failed to post the revised code.

The second thing wrong is that you are not identifying what you are printing/writing, so you have to guess what the numbers mean. I HATE guessing.

Print something before each value, so you KNOW what the value means.

PaulS:
"the wrong" is that you changed your code and then failed to post the revised code.

The second thing wrong is that you are not identifying what you are printing/writing, so you have to guess what the numbers mean. I HATE guessing.

Print something before each value, so you KNOW what the value means.

It print the Ids of the Tag and send it to wamp server , but it send zero value dosent send the Ids.

#include <ESP8266WiFi.h>
#include <WiFiClient.h> 
#include <ESP8266WebServer.h>
#include <ESP8266HTTPClient.h>  
#include <SoftwareSerial.h>
SoftwareSerial Serial2 (13,15); 

const char *ssid = "My SSID"; 
const char *password = "Passward";
const char *host = "192.168.0.0";

String getData ,Link;
String CardID ="" ;
 String IDES="" ;

void setup() {
 
  Serial.begin( 115200 );
  Serial2.begin( 115200 );
  Serial.println("Hi there");

 WiFi.mode(WIFI_OFF);        //Prevents reconnection issue (taking too long to connect)
  delay(1000);
  WiFi.mode(WIFI_STA);        //This line hides the viewing of ESP as wifi hotspot
  
  WiFi.begin(ssid, password);     //Connect to your WiFi router
  Serial.println("");

 if(WiFi.status() != WL_CONNECTED){
    WiFi.disconnect();
    WiFi.mode(WIFI_STA);
    Serial.print("Connecting to ");
    Serial.println(ssid);
    WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
    Serial.println("");
    Serial.println("Connected");
    Serial.print("IP address: ");
    Serial.println(WiFi.localIP());  //IP address assigned to your ESP
  }}

void loop() {
  
  if (Serial2.available())
  {
  IDES = Serial2.readString(); 
  Serial.print ("IDE = "); 
  Serial.print(IDES); 
  
  HTTPClient http; 
  
  getData = "?CardID=" + IDES;  //Note "?" added at front
  Link = "http://192.168.0.0/loginsystem/postdemo.php" + getData;

  
   http.begin(Link);
  

  int httpCode = http.GET();            //Send the request
  delay(10);
  String payload = http.getString();

  Serial.println(httpCode);   //Print HTTP return code
  Serial.println(payload); //Print request response payload
  Serial.println(CardID);     //Print Card ID 

   CardID = "";
  getData = "";
  Link = "";
  http.end();
  
  }}
  Serial.println(httpCode);   //Print HTTP return code
  Serial.println(payload); //Print request response payload
  Serial.println(CardID);     //Print Card ID

Print 3 pieces of data without a clue what each piece is. Keep the useless data to yourself.

You haven't shared the php script, either.

I guess you don't really want help.

This is my PHP codes

<?php
session_start();
    //Connect to database
    require('connectDB.php');
//**********************************************************************************************
    
    //Get current date and time
    date_default_timezone_set('Asia/Riyadh');
    $d = date("Y-m-d");

    $Tarrive = mktime(6,15,00);
    $TimeArrive = date("H:i:sa", $Tarrive);
//**********************************************************************************************   
    $Tleft = mktime(02,30,00);
    $Timeleft = date("H:i:sa", $Tleft);

    if (!empty($_POST['seldate'])) 
  {
    $seldate = $_POST['date'];
  }
else
  {
    $seldate = $d;
  }
    $_SESSION["exportdata"] = $seldate;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">	
<meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Users Logs</title>
<script src="https://code.jquery.com/jquery-3.3.1.js"
        integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
        crossorigin="anonymous">
</script>
<script>
  $(document).ready(function(){
    setInterval(function(){
      $("#cards").load("load-users.php")
    });
  });
</script>
<style>
body {background-image:url("image/Backgr.png");background-repeat:no-repeat;background-attachment:fixed;
	  background-position: top right;
	  background-size: cover;}

header .head h1 {font-family:aguafina-script;text-align: center;color:#ddd;}
header .head img {float: left;}
header .opt {float: right;margin: -100px 20px 0px 0px}
header .opt a {text-decoration: none;font-family:cursive;text-align: center;font-size:20px;color:red;margin-right: 15px}
header .opt a:hover {opacity: 0.8;cursor: pointer;}
header .opt #inp {padding:3px;margin:0px 0px 0px 33px;background-color:#00A8A9;font-family:cursive;font-size:16px; opacity: 0.6;color:red;}
header .opt #inp:hover {background-color: #00A8A9; opacity: 0.8;}
header .opt input {padding-left:5px;margin:2px 0px 3px 20px;border-radius:7px;border-color: #A40D0F ;background-color:#8E8989; color: white;}
header .opt p {font-family:cursive;text-align: left;font-size:19px;color:#f2f2f2;}
.export {margin: 0px 0px 10px 20px; background-color:#900C3F ;font-family:cursive;border-radius: 7px;width: 145px;height: 28px;color: #FFC300; border-color: #581845;font-size:17px}
.export:hover {cursor: pointer;background-color:#C70039}
#table {
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    border-collapse: collapse;
    width: 100%;
}

#table td, #table th {
    border: 1px solid #ddd;
    padding: 8px;
     opacity: 0.6;
}

#table tr:nth-child(even){background-color: #f2f2f2;}
#table tr:nth-child(odd){background-color: #f2f2f2;opacity: 0.9;}

#table tr:hover {background-color: #ddd; opacity: 0.8;}

#table th {
	 opacity: 0.6;
    padding-top: 12px;
    padding-bottom: 12px;
    text-align: left;
    background-color: #00A8A9;
    color: white;
}
</style>
</head>
<body>
	<header >
		<div class="head">
			<img src="image/TULOGO.png" width="150" height="100">
			<img src="image/icon2030.png" width="150" height="100" style="float: right;margin:0px 20px 0px 0px"></a> 
			<h1><font color= 'black' >Student's Attendance Monitoring System In The</font>

      <font color= 'black' >School Bus Using RFID </font></h1>
		</div>	        
		<div class="opt">
			<table border="0">
				<tr>
					<td><a href="AddCard.php">Add a new User<br style="margin:170px -100px -50px -50px"
                        <img src="image/add.png" style="margin:0px 0px 0px 0px" width="30" title="Add"></a></td>
					<td><p>Select the date log:<br  style="margin:90px 200px -50px 100px"
					<form method="POST" action="">
					<input type="date" name="date">

					<input type="submit" name="seldate" value="Select Date" id="inp" style="left;margin:14px 10px -100px 100">
					</form>
					</p></td>
				</tr>
			</table>
		</div>
	</header>
<h2 style="margin-left: 15px;">
  Time to arrive :<?php echo $TimeArrive?>

  Time to leave :<?php echo $Timeleft?>
</h2>

<form method="post" action="export.php">
  <input type="submit" name="export" class="export" value="Export to Excel" />
</form>
<div id="cards" class="cards">
</div>
</body>
</html>

and

<?php
    //Connect to database
    require('connectDB.php');
//**********************************************************************************************
    //Get current date and time
    date_default_timezone_set('Asia/Riyadh');
    $d = date("Y-m-d");
    $t = date("h:i:s");
//**********************************************************************************************
    $Tarrive = mktime(1,15,00);
    $TimeArrive = date("H:i:sa", $Tarrive);
//**********************************************************************************************   
    $Tleft = mktime(02,30,00);
    $Timeleft = date("H:i:sa", $Tleft);
//**********************************************************************************************
    
if(!empty($_GET['CardID']))
    {
       $Card = $_GET['CardID'];
       $sql = "SELECT * FROM users WHERE CardID='$Card'";
       $result = mysqli_query($conn,$sql);
       
       if (mysqli_num_rows($result) > 0 )
        { 
            $row = mysqli_fetch_assoc($result);

            if (!empty($row['username']) && !empty($row['SerialNumber'])) 
                {
                    
                $sqll = "SELECT * FROM logs WHERE CardNumber='$Card' AND DateLog=CURDATE()";
                $resultl = mysqli_query($conn,$sqll);

                $rowl = mysqli_fetch_assoc($resultl);

                if ( mysqli_num_rows($resultl) > 0 )
                    {   
                        if ($t >= $Timeleft && $rowl['TimeIn'] <= $TimeArrive) 
                                {
                                $UserStat = "Arrived and Left on time";
                                }
                        elseif ($t < $Timeleft && $rowl['TimeIn'] > $TimeArrive)
                                {   
                                $UserStat = "Arrived late and Left early";
                                }
                        elseif ($t < $Timeleft && $rowl['TimeIn'] <= $TimeArrive) 
                                {
                                $UserStat = "Arrived on time and Left early";
                                }
                        elseif ($t >= $Timeleft && $rowl['TimeIn'] > $TimeArrive) 
                                {
                                $UserStat = "Arrived late and Left on time";
                                }

                        $sqlll="UPDATE logs SET TimeOut=CURTIME(), UserStat ='$UserStat' WHERE CardNumber='$Card' AND DateLog=CURDATE()";
                        if ($conn->query($sqlll) === true)
                            {
                            echo "logout";
                            }
                    }
                //*******************************************************************************
                else
                    {
                    if ($t <= $TimeArrive) 
                        {
                        $UserStat = "Arrived on time";
                        }
                    else
                        {
                        $UserStat = "Arrived late";
                        }
                    $Uname = $row['username'];
                    $Number = $row['SerialNumber'];

$sqll = "INSERT INTO logs (CardNumber, Name, SerialNumber, DateLog, TimeIn, UserStat) "
                . "VALUES ('$Card' ,'$Uname', '$Number', CURDATE(), CURTIME(), '$UserStat')";
                    if ($conn->query($sqll) === true)
                        {
                        echo "login";
                        }
                    } 
                }
            //**********************************************************************************
            else
                {
            echo "Cardavailable";
                }
        }
//**********************************************************************************************
        else 
        {           
        $sql = "INSERT INTO users (CardID) " . "VALUES ('$Card')";
    
        if ($conn->query($sql) === true)
            {
                echo "succesful";
            }
        }
    }
    else{
    	echo "Empty Card ID";
    }
?>

I am sorry that I dont Put in the first place.
I am just new on all of this .

This is my PHP codes

Again data with no way to identify which is which. I give up.

It worked .
Thanke you.