Hello, I'm migrating from MySQL to PDO and I'm having a hard time putting two selects in a table.
try{
$CON = new PDO("mysql:host=localhost;dbname=tcc", 'root', '1234');
}
catch (PDOException $e)
{
echo "Erro : ".$e->getMessage();
}
$select = "select * from MATERIA";
$resultado = $CON->query($select);
$select2 = "select * from ALUNO";
$resultado2 = $CON->query($select2);
while($row = $resultado->fetch(PDO::FETCH_BOTH) and $row2=$resultado2->fetch(PDO::FETCH_BOTH)){
echo "<tr><td>".$row['NOME']."</td><td>".$row2['NOME']."</td>";
}
The problem is that when the results of query 1 are finished, it stops listing other students, and I would like it to continue to write them.