Save database data in array?

Asked

Viewed 20 times

0

I have a database where saved email and file names attached by users, which can attach more than one file, and would like to show all the files that the user attached on the screen, I thought to save in array and use the var_dump to show, however it is not being saved in the array, someone has some idea of how to do this or what is wrong in my code?

<?php
  session_start();
  require_once('conecta.php');
  $resultado = mysqli_query("SELECT * FROM arquivos WHERE email_vol = '$email'");
  while($dados = mysql_fetch_array($resultado)) {
    var_dump($resultado);
  }
?>
  • 1

    the var_dump() needs to be in $dados not in $resultado

  • @Even this way he shows nothing!

  • 1

    $email if it has any value? failed to pass the connection as the first argument in mysqli_query()

  • @rray understood, now it worked yes, I was really missing pass the connection, thank you very much!!

  • Haha because it’s sometimes that i is forgotten :)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.