I have a unique situation, i have 3 tables and one description table id like to pull info from.
i was looking at join and im new to join mysql command and i do not understand how to make it work with what i need
im not saying it should be used im open to other ways it just seamed on trying to figure this out it was the logical choice to use.
here my problem
i have tables denoted by - with there field names under them as
what im looking to do it:
i need to look at Contact table and look for username and password if it is not found look in Client for username and password if that is not found look in EndUser for Login and Password, i know i need to do 'WHERE `Active` = '1' on all the tables someplace too.
my farther problem is if its the first two (Contact and Client) tables i need the info joined by ContactID and ClientID so i can pull the info Company_name and Contact Name etc from appropriate tables.
if the look up is EndUser i need just that tables info and the reference of UserTypeID description form the UserTypeID form EndUser along with the FirstName and LastName.
Im trying to make this so if a user logs in the admin(EndUser) and client can log into there accounts, but the tables i have are in 3 different spots(and i cant change them) i would have made it one table for login info and then broke up the tables in client/contact/admin using ids for each) but i didnt make the tables so im stuck with looking them up this way.
so whats the best way to do this please in MySQLi with php i really only need the sql statement but i wont complain if the php is there too
Thank you in advance for any code or help you may provide.