Well, I made this code to display all the files that were attached by the user, however it only shows the file with the smallest ID, ie the first files in the database. This is the code I used:
<div class="container">
<div class="text-center">
<h1 class="tittlenoticia" style="color: black;">Arquivos anexados</h1>
<?php
require_once('conecta.php');
$pasta = "uploads/";
$consulta = mysqli_query($link, "SELECT * FROM arquivos WHERE email_vol = '$email'");
var_dump($consulta);
if ($resultado = mysqli_fetch_array($consulta)) {
do {
echo "<a href=\"" . $pasta . $resultado["nomearq"] . "\">" . $resultado["nomearq"] . "</a><br />";
}
while ($resultado = mysql_fetch_array($consulta));
}
?>
</div>
</div>
I made the var_dump of the variable $consulta
and the following appeared:
object(mysqli_result)#3 (5) { ["current_field"]=> int(0) ["field_count"]=> int(3) ["lengths"]=> NULL ["num_rows"]=> int(9) ["type"]=> int(0) }
Does anyone have any idea why it does not show the other files? And one more thing, this php code only runs if I send a file, but I wanted it to run at the start of the page, if you have any ideas I'm grateful too!