2
I have 3 tables and I want to compare their value, I can do with 2 using the JOIN
but when I put JOIN
in the third point php doesn’t work.
Code in PHP:
$agora = "select * from usuario u
join dia_usuario du
on u.usuario_id = du.id_diarista
join diarista d
on d.id = ud.id_diarista";
$sim = mys[![inserir a descrição da imagem aqui][1]][1]qli_query($conn,$agora);
while ($row_usuario2 = mysqli_fetch_assoc($sim)) {
$ola2 = $row_usuario2['nome'];
}
User table
Table dia_usuario
Daily table
Return of consultation
which error php shows?
– Anderson Henrique
@Enerson Silva puts Anderson’s answer as correct pf.
– White
Simple, your problem is in the second table, you only have the id_diarista 3 and 5 so it only brings the user Emerson that has the user id equal to 3
– Anderson Henrique