0
I’m trying to pull the information in Mysql and show it in php, with a filter in the name of the room
$reserva = mysqli_query($connect, 'select * from reserva join curso on reserva.idCurso = curso.idCurso join professor on reserva.idProfessor = professor.idProfessor join sala on reserva.idSala = sala.idSala;');
$reservaArray = mysqli_fetch_array($reserva);
$selectSala = mysqli_query($connect, 'SELECT * FROM sala') or die('Deu erro');
while($teste = mysqli_fetch_array($selectSala)){
$arraySala[] = $teste['nomeSala'];
}
for ($sala=9; $sala<=20; $sala++){
echo '<tr>
<th scope="row">'.$arraySala[$sala].'</th>
<td colspan="3" class="text-center">';
if($arraySala[$sala] == $reservaArray['nomeSala']){
echo $reservaArray['idCurso'].' - '.$reservaArray['nomeCurso'].' - '.$reservaArray['nomeProfessor'];
}
echo'</td>
</tr>';
}
there are 3 records, but only the first one is shown. I’ve tried using the while
but I couldn’t execute
this is the second part of the table, so I started 1 more than the previous
– Jhonata Kumaki
Hello @Jhonata Welcome to Stackoverflow, please add the code that queries the database to supplement the question
– Lucas Duete