i am designing an rfid attendance system with arduino uno, esp8266-01 wifi module, and a rfid reader. The task is to read a rfid card and to send its unique id number to a webpage (coded in php) which stores the data in a database. We sent at commands to the module from arduino ide serial monitor through a uno board. We used Serial_ophttp POST method first to send the read rfid number to the webpage. As that attempt was a failure we tried using GET method. But neither of those methods worked.
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn ) {
die('Could not connect: ' . mysql_error());
}
$Data=$_GET['Data'];
//$Data='Data test';
echo "Data is :" . $Data;
$sql = "INSERT INTO test_tab (Data) VALUES ('$Data')";
mysql_select_db('robot');
$retval = mysql_query( $sql, $conn );
if(! $retval ) {
die('Could not enter data: ' . mysql_error());
}
echo "Entered data successfully\n";
mysql_close($conn);
?>