Hello I am learnign Joins in MySQL, and I am attampting to create a login system where two tables are involved.
Table One: "EE_data" contains employee data.
Table Two: "SYS_accesstype" contains access levels.
The primary key of SYS_accesstype is sat_id, which is joined to EE_data by a field of the same name.
Heres the question:
I am trying to select username, password from EE_data, and sat_level from SYS_accesstype using one query.
The goal is to have a user log in with username/password and retrieve that record from the database, but also in that same query to return the fields in SYS_accesstype that match the Primary Key sat_id from the matching employee.
Is this possable?
Here is what ive tried so far, but i continue to get syntax errors:
SELECT eed_user, eed_pass, sat_level, sat_desc, sat_name
FROM EE_data, SYS_accesstype
WHERE SYS_accesstype.sat_id = EE_data.sat_id AND (eed_user = '".addslashes($POST["xuser"])."' AND eed_pass = '".addslashes($POST["xpass"])."')
Any help would be great 🙂
Thanks!
:Figment