The problem is as follows:
I have the tables:
Whatareforeignkeysinthefollowingtable:
AndIneedtopullallthenamesofthe"connector_model", "connector_name" and "connector_type" columns and concatenate and echo an individual search.
To do this, I tried the following query, but it did not work, because you need to make multiple selects in the same query: Note: in this attempt I only put the selects of the model_connector_tables, the_type_connectors and connectors, I could not fit the_gear_connectors 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, it is always returning this error:
Does anyone have a suggestion or a light that can help me?