0
The problem is this:
I have the tables:
Which are foreign keys in the following table:
And I need to pull all the column names "modelo_conector", "nome_genero_conector" and "tipo_de_conector" and concatenate and give an echo in a certain search.
For this, I tried to make the following query, but it did not work, because you need to make several selects in the same query: Obs: in this attempt I only put the selects of the connector_models tables, connectores_types and connectors, I could not fit the connectores_generos table:
function listaConectores($conexao) {
$conectores = array();
$resultado = mysqli_query($conexao,
"select
c.*
ct.tipo_de_conector as tipo_de_conector,
temp_sql.modelo_conector
from
(select
c.id_conector
cm.modelo_conector
from
conectores as c
join
conectores_modelos as cm
on
c.conectores_modelos_id_conector_modelo = cm.id_conector_modelo
)
temp_sql
join
conectores as c
on
temp_sql.id_conector = c.id_conector
join
conectores_tipos as ct
c.conectores_tipos_id_conector_tipo = ct.id_conector_tipo"
);
while($conector = mysqli_fetch_assoc($resultado)) {
array_push($conectores, $conector);
}
return $conectores;
}
However, he is always returning me this mistake:
Does anyone have a suggestion or a light that can help me?