Código PHP:
  
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        $conexion=mysqli_connect("Localhost", "root", "root")
                or die("Fallo en el establecimiento de la conexion");
        mysqli_select_db($conexion, "BD_EMPLEADOS")
                or die("Error en la seleccion de la base de datos");
        $result=  mysqli_query($conexion, "select * from empleados")
                or die("Error en la consulta SQL");
        ?>
        <table border="1">
            <tr>
                <th>NIF</th>
                <th>NOMBRE</th>
                <th>APELLIDOS</th>
                <th>SALARIO</th>
                <th>ALTA</th>
                <th>DEPARTAMENTO</th>
            </tr>
            <?php
            foreach ($result as $row){?>
            <tr>                
                <td><?php echo $row["NIF"]; ?></td>
                <td><?php echo $row["NOMBRE"]; ?></td>
                <td><?php echo $row["APELLIDOS"]; ?></td>
                <td><?php echo $row["SALARIO"]; ?></td>
                <td><?php echo $row["ALTA"]; ?></td>
                <td><?php echo $row["DEPARTAMENTO"]; ?></td>
            </tr>
            <?php } ?>
        </table>
        <br>
        <a href="index.php">Volver a la pantalla de inicio</a>
    </body>
</html>   Muchas gracias
 
 





 Este tema le ha gustado a 1 personas
Este tema le ha gustado a 1 personas