Código PHP:
<?php
include("../Conexion/conexion.php");
session_start();
if ($_POST){
$nf=$_POST["nf"];
}
$sql="select * from horas2 where Numero_Ficha='$nf'";
$datos= mysqli_query($conexion,$sql);
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Consultar</title>
</head>
<body>
<form>
<fieldset>
<form action="" method="POST">
<legend>
Consultar
</legend>
<label for="ficha">
Número de ficha <input type="text" name="nf">
</label>
<label for="ficha">
<input type="submit" value="Consultar">
</label>
</form>
<table border="2" align="center">
<tr>
<td align="center">Número de ficha</td>
<td align="center">Fecha</td>
<td align="center">Empleados</td>
<td align="center">Entrada</td>
<td align="center">Salida</td>
<td align="center">Entrada #2</td>
<td align="center">Salida #2</td>
<td align="center">Total</td>
</tr>
<?php
if ($_POST){
$nf=$_POST["nf"];
if ($nf>0){
while ($reg = mysqli_fetch_array($datos)) {
?>
<tr>
<td><?php echo $reg ["Numero_Ficha"]; ?></td>
<td><?php echo $reg ["Fecha"]; ?></td>
<td><?php echo $reg ["Empleado"]; ?></td>
<td><?php echo $reg ["entrada"]; ?></td>
<td><?php echo $reg ["salida"]; ?></td>
<td><?php echo $reg ["Entrada2"]; ?></td>
<td><?php echo $reg ["Salida2"]; ?></td>
<td><?php echo $reg ["Total"]; ?></td>
</tr>
<?php
}}}
?>
</fieldset>
</body>
</head>