I have a site which has two type of users, doctor and patient. I store the information about these two types of users in two different tables. When a user is logging in, I want check if the login name submitted by the user exists in the first table (ex: patient) or in the second table (ex: doctor). How I can do this?
Below is part of my code containing the SELECT statement that I have written:
$query =
"SELECT username, password
FROM patient
WHERE username='$username' AND password='$password'";
I'm currently SELECTing from the patient table, but I want to know how to SELECT both from the patient table and the doctor table.
Can you help me please?