<thead>
                              <tr>
                                <th>Código</th>
                                <th>Nombres</th>
                                <th>Apellidos</th>
                                <th>Fecha Ultimo Ingreso</th>
                              </tr>
                            </thead>
                            <tbody>
                            <?php 
$result = $datab->consultar_students();
$num = mysql_numrows($result);
$contador = 0;
if ($num > 0) {
    while ($row = mysql_fetch_row($result)) {
        $res_ingres = $datab->consultar_ultimo_ingreso($row[0]);
        $last_login_app = mysql_fetch_row($res_ingres);
        ?>
                                    <tr>
                                        <td><?php 
        echo "" . $row[0];
        ?>
</td>
                                        <td><?php 
        echo "" . $row[1];
        ?>
</td>
                                        <td><?php 
        echo "" . $row[2];
        ?>
</td>