I was trying to validate a user attendance whether the user had already timed in using boolean in PHP and SQL. Here is my code:
$user_att_status = "SELECT * FROM event_attendance WHERE user_att_status=1";
if ($user_event_att_status = true) {
echo "You already had your time in for today";
else {
$sql = "INSERT INTO event_attendance (user_qr_code, user_time_in, att_date, user_att_status) VALUES ('$user_qr_code', '$time', '$date', 0)";
}
However, it will only add another row for the same user but not showing the error. Help would be greatly appreciated. Thank you