I want to check if an id is registered in user table or not in MySQL, if it is registered in user table make an entry of RFID and if not echo invalid id. I have done this so far which is making entry without any checking. This is tbl_attendance while ids are registered in tbl_user. I am getting id from an Arduino.
<?php
include ('connection.php');
$sql_insert = "INSERT INTO tbl_attendance (rfid_uid) VALUES ('".$_GET["rfid_uid"]."')";
if(mysqli_query($con,$sql_insert))
{
mysqli_close($con);
}
?>