I have these 3 tables with the following columns:
employee: empId (PK), hireDate, jobTitle, department (FK), status (FK)status: statusId, statusDescdepartment: departmentId, deptName, supervisorId, deptHeadId
What I want to do is to display the following columns: hireDate, jobTitle, deptName, statusDesc
The problem that I'm encountering is that it does not display the statusDesc and deptName records.
Here's my code/sql query:
$empId = $_GET['empId'];
$result = mysql_query("SELECT e.empId, e.hireDate, e.jobTitle, d.deptName, s.statusDesc
FROM employee e , department d, status s
WHERE e.department = d.departmentId AND e.status = s.statusId AND e.empId = $empId;");