Loop interrupts script, but does not give error

0

I am putting together a list that collects user data. As some data are in different tables (the one of appendices, precisely) I have set up a query select to get only those attachments that have the same id of user (table that I called from attach_user_id previously already fed by the form) and I threw in a variable to be able to print from inside the loop that makes the query in the students table. The script does exactly what I want, or rather, almost. The list is printed, formatted, everything ok BUT the page is cut off and the script is no more than the last line of the table, ie it does not load the footer. I can not understand where I'm going wrong, and the script does not return any errors.

Where am I going wrong?

<?php // o erro esta daqui em diante
while($user = mysqli_fetch_array($users) or die(mysqli_error($sql_con)))
{
    $user_id = $user['id'];
    $user_attachments = mysqli_query($sql_con,"SELECT attach_name,attach_path,attach_user_id FROM " . ATTACHMENTS_TABLE . " WHERE attach_user_id LIKE '$user_id'") or die(mysqli_error($sql_con));
    $docs = mysqli_fetch_array($user_attachments);
        ?><tr>
            <td><font face='Calibri' size='2' color='#888888'><?php echo $user['nome'] . "  "; ?></font></td>
            <td><font face='Calibri' size='2' color='#888888'><?php echo $user['dia'] . " de " . str_replace_assoc($mes,$user['mes']) . " de " . $user['ano']; ?></font></td>
            <td><font face='Calibri' size='2' color='#888888'><?php echo $user['curso'] . "  "; ?></font></td>
            <td><font face='Calibri' size='2' color='#888888'><?php echo $user['unidade'] . "  "; ?></font></td>
            <td><font face='Calibri' size='2' color='#888888'><?php echo $user['endereco'] . "  "; ?></font></td>
            <td><font face='Calibri' size='2' color='#888888'><?php echo $user['bairro'] . "  "; ?></font></td>
            <td><font face='Calibri' size='2' color='#888888'><?php echo $user['cep'] . "  "; ?></font></td>
            <td><font face='Calibri' size='2' color='#888888'><?php echo $user['numero'] . "  "; ?></font></td>
            <td><font face='Calibri' size='2' color='#888888'><?php echo $user['rg'] . "  "; ?></font></td>
            <td><font face='Calibri' size='2' color='#888888'><?php echo $user['cpf'] . "  " ; ?></font></td>
            <td align='center'><font face='Calibri' size='2' color='#888888'><a href='<?php echo $docs['attach_path'] . $docs['attach_name']; ?>'><img src='doc.png' alt='Ver documento anexado' style='width:16px;height:20px;'></a></font></td>
            <td><font face='Calibri' size='2' color='#888888'><?php echo $user['email'] . "  "; ?></font></td>
            <td><font face='Calibri' size='2' color='#888888'><?php echo $user['telefone'] . "  "; ?></font></td>
            <td><font face='Calibri' size='2' color='#888888'><?php echo $user['celular'] . "  "; ?></font></td>
            <td><font face='Calibri' size='2' color='#888888'><?php echo $user['site'] . "  "; ?></font></td>
        </tr><!-- a pagina so e impressa ate exatamente neste ponto -->
<?php } ?>
</table>
<hr />
<script type="text/javascript">
function voltar()
{
         location.href="form.php"
}
function lista()
{
         location.href="lista.php"
}
</script>
<p align="center"><button onclick="lista()">Recarregar lista</button> <button onclick="voltar()">Novo cadastro</button></p>
<br/><br/>
<?php INCLUDE('./footer.php'); ?>
    
asked by anonymous 30.09.2017 / 03:43

0 answers