<?php
$username='miguelde_modulo4';
$password='modulo4';
$dbname='miguelde_modulo4';
$host='localhost';
echo'
<html>
<h3> Banco de Dados Lucas Padia e Gustavo</h3>
<table border = 2>
<tr>

<td>IdMac</td>
<td>Nome da placa</td>
<td>Contador</td>
<td>Ativo</td>
</tr>
';
try {
 $conn = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
 $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 $sql='SELECT * FROM maclzjo ';
 $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><tr>';
 }echo'</table>';
} catch(PDOException $e) {
 echo 'ERROR: ' . $e->getMessage();
}
 ?>