I have two tables, one for admins, and one for users. I want a single html select box of both admins and users. I only want active users/admins, where that user/admin also has an entry in the foo table.
Here is my MySQL query so far:
SELECT * FROM users u, admins a, foo f WHERE u.active ='1' AND (a.admin_id = f.admin_id OR u.user_id = f.user_id)
Unfortunately, this puts out a nonsense result.
Thanks in advance!
I’m going to guess your tables are set up like this.
If that is the case then apart from rethinking your database design (one table for all users with each user being assigned a user_level) you could try a
UNION