sexta-feira, 27 de setembro de 2019

aula dia 27 de setembro de 2019

<?php
#http://localhost:8080/si/usersListar.php
require_once("connection.php");
$table="users";
$sql = "SELECT * FROM $table";
$query=mysqli_query($connect, $sql);
$total=mysqli_num_rows($query);
if($total>0) {
    $fetch=mysqli_fetch_assoc($query);
    #echo $fetch['username'];
}
?>
<!DOCTYPE html>
<html lang="pt">

<head>
    <meta charset="UTF-8">
    <title>SI</title>
    <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
</head>

<body>
    <div class="w3-container">
        <h2>Lista de users da base de dados netwoork</h2>
        <table class="w3-table-all">
            <thead>
                <tr class="w3-light-grey w3-hover-red">
                    <th>ID</th>
                    <th>Username</th>
                    <th>Pasword</th>
                </tr>
            </thead>
       
            <tr class="w3-hover-green">
                <td><?php echo $fetch['id'];?></td>
                <td><?php echo $fetch['username'];?></td>
                <td><?php echo $fetch['psw'];?></td>
            </tr>
         
        </table>
    </div>
</body>

</html>

Sem comentários:

Enviar um comentário