<?php
  require "login/dbconf.php";
  $conn = mysqli_connect($host,$user,$password,$db_name);

  $mysqli = new mysqli($host, $user, $password, $db_name);

  $mysqli->set_charset("utf8");

  if(mysqli_connect_errno()){
      die("Conexão falhou: ".mysqli_connect_errno());
  }

  $usr = $_SESSION['username'];

  $sql = "SELECT * FROM myblob WHERE cpfusr = '$usr'";

  $result = mysqli_query($conn,$sql);

  while($row = mysqli_fetch_assoc($result)){
    if($row['cpfusr'] == $_SESSION['username']){
      echo "<li><a target='_blank' href='".$row['filepath']."' class='btn btn-primary'>".$row['nome_arquivo']."</a></li><br/>";
    }
  }

  

  

  /* while($row = $stat->fetch()){
    if($row['cpfusr'] == $_SESSION['username']){
      
    }
  } */

  mysqli_close($conn);
?>