The solution I left in comment would be the most appropriate:
SELECT * FROM Tabela1 JOIN Tabela2 ON Tabela1.id = Tabela2.Id_fk;
But to be consistent between answer / question here is a solution to what you asked for:
In case that table2 can only have one line with the same Id_fk:
$selTab1 = mysqli_query($conn, "SELECT * FROM tabela1;");
$dataJoin = array();
while ($rowTab1 = $selTab1->fetch_assoc()) {
$selTab2 = mysqli_query($conn, "SELECT * FROM tabela2 where Id_fk={$rowTab1['id']};");
if($selTab2->num_rows > 0) {
$rowTab2 = $selTab2->fetch_assoc();
$dataJoin[] = array(
'tab1_id' => $rowTab1['id'],
'Modelo' => $rowTab1['Modelo'],
'tab2_id' => $rowTab2['id'],
'cor' => $rowTab2['cor']
);
}
}
echo '<pre>', print_r($dataJoin), '</pre>'; // aqui já vai ter os dados das duas
If table2 can have more than one line with the same Id_fk:
$selTab1 = mysqli_query($conn, "SELECT * FROM tabela1;");
$dataJoin = array();
while ($rowTab1 = $selTab1->fetch_assoc()) {
$selTab2 = mysqli_query($conn, "SELECT * FROM tabela2 where Id_fk={$rowTab1['id']};");
while($rowTab2 = $selTab2->fetch_assoc()) {
$dataJoin[] = array(
'tab1_id' => $rowTab1['id'],
'Modelo' => $rowTab1['Modelo'],
'tab2_id' => $rowTab2['id'],
'cor' => $rowTab2['cor']
);
}
}
echo '<pre>', print_r($dataJoin), '</pre>'; // aqui já vai ter os dados das duas