Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $bd = new PDO('mysql:host=localhost;dbname=engweb2015', 'jcramalho', '4140');
- echo "<h1 align='center'>Gestão de Professores</h1>";
- echo "<ul>";
- echo "<li><a href='loadXML.html'>Carregar do XML</a></li>";
- echo "<li><a href='reset.html'>Apagar a tabela</a></li>";
- echo "</ul>";
- echo "<table border='1' style='text-align:center;'>".
- "<tr><th>Código</th><th>Nome</th>".
- "<th>Departamento</th><th>Email</th><th>Ops</th></tr>";
- $query = $bd->query("SELECT * FROM Professor");
- while ($linha = $query->fetch()){
- echo "<tr><td>".$linha['codigoProf']."</td>";
- echo "<td>".$linha['nome']."</td>";
- echo "<td>".$linha['departamento']."</td>";
- echo "<td>".$linha['email']."</td>";
- echo "<td><a href='alterarProf.php?idProf=".
- $linha['codigoProf']."'>Alterar</a>".
- " <a href='removerProf.php?idProf=".
- $linha['codigoProf']."'>Remover</a>";
- echo "</tr>";
- }
- echo "</table><br/> <a href='index.html'>Voltar ao ínicio</a>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment