Ok so I have this waiting list with people already registered and I have a "NEXT PERSON" button that calls a PHP script with AJAX that is supposed to eliminate the oldest record (in other words the next person) from the waiting list.
Well I'm trying to build this query that only updates the oldest person in the table that has not yet been attended. Here is my query:
UPDATE queue
SET ATTENDED='1'
WHERE VISIT_DATE = (SELECT * WHERE ATTENDED='0' ORDER BY VISIT_DATE ASC LIMIT 1)
Here is my table (queue):
ID int(11)
GUEST_NAME varchar(50)
VISIT_DATE datetime(6)
ATTENDED int(11)
The problem is that I'm getting the error "MySQL error 1241: Operand should contain 1 column(s)".
I'm doing it wrong?