Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. <html>
  2. <body>
  3. <?php
  4. $link = mysqli_connect ("localhost", "nome_usuario", "senha_usuario", "teste");
  5. $query = "SELECT * FROM usuario";
  6. $result = mysqli_query ($link, $query);
  7.  
  8. /* Mostrando os resultados em HTML */
  9. echo "<table>\n";
  10. while ($line = mysql_fetch_array($result, MYSQL_ASSOC)){
  11. echo "\t<tr>\n";
  12. foreach ($line as $value){
  13. echo "\t\t<td>$value</td>\n";
  14. }
  15. echo "\t</tr>\n";
  16. }
  17.  
  18. echo "</table>\n";
  19.  
  20. /* Libera o conjunto de resultados */
  21. mysqli_free_result($result);
  22.  
  23. /* Fechando a conexão */
  24. mysqli_close($link);
  25. ?>
  26.  
  27. <form action="index.html" method="post">
  28. Voltar: <input type="submit" />
  29. </form>
  30. </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement