Did you start by writing a query that gave the results you wanted?
Like:
SELECT firstname
FROM users
WHERE Appointments.patient_id = patients.user_id
AND patients.user_id = user.id
(I do not have all the criteria to write the query you need.)
As your code has no literal SQL, the problem is either your query or your implementation of it in whatever you are writing.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Did you start by writing a query that gave the results you wanted?
Like:
SELECT firstname
FROM users
WHERE Appointments.patient_id = patients.user_id
AND patients.user_id = user.id
(I do not have all the criteria to write the query you need.)
As your code has no literal SQL, the problem is either your query or your implementation of it in whatever you are writing.