<?php
$username='miguelde_modulo4';
$password='modulo4';
$dbname='miguelde_modulo4';
$host='localhost';
try {
$conn = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql='SELECT * FROM aluno ';
echo'<table border =1>
<tr>
<th>
<td>IdAluno</td>
<td>Aluno</td>
<td>Telefone</td>
<td>Email</td>
<td>Peso</td>
<td>Altura</td>
</tr>';
$data = $conn->query($sql);
foreach($data as $row) {
echo'<td>'.($row[0]).'</td>';
echo'<td>'.($row[1]).'</td>';
echo'<td>'.($row[2]).'</td>';
echo'<td>'.($row[3]).'</td>';
echo'<td>'.($row[4]).'</td>';
echo'<td>'.($row[5]).'</td></tr>';

}echo'</table>';
} catch(PDOException $e) {
echo 'ERROR: ' . $e->getMessage();
}
?>