-2
I’m making a project management system, on the HOME page will appear all projects. In mysql I have in the PROJECTS table the client and project manager saved as User and Client ID... which has their data in other CLIENTS and USERS tabalas. I’m doing a SELECT in PHP in mysql that should return me all projects, but returns only one.
$sql = "SELECT projects.id P_ID, projects.gerente P_GERENTE, projects.cliente P_CLIENTE, projects.nome P_NOME, projects.area P_AREA, projects.data_final_plan P_DATA, users.nome U_NOME, users.sobrenome U_SOBRENOME, clients.nome C_NOME FROM projects INNER JOIN users ON projects.gerente = users.id INNER JOIN clients ON projects.cliente = clients.id";
Does anyone know why? I think by the Projects.manager = users.id and Projects.client = clients.id...
I think because this ID=1 CLIENT=2 MANAGER=1 does not appear and ID=1 CLIENT=1 MANAGER=1 and this appears!! I need to make SELECT return without comparing if the manager ID matches the client ID!
How are the tables 'clients' and 'users'? You made their FK with the table 'Projects'?
– Wilson Faustino