title: How to create a html table with database fields and respective files uploaded to server
body: <p>I'm trying to create a table that displays file descriptions(From mySQL database) and their respective files in my server.
  The file details are uploaded on a HTML form together with the respective file. 
  Here is the code, (It displays a deformed incorrect table)</p>
  
  <pre><code>&lt;?php
       #Displaying files
      $getgus = "SELECT name,description,price,platform,compatible_devices,type,date,downloads,filename FROM software ORDER BY downloads desc";
  
      $result = mysqli_query($conn,$getgus)
      or die("SELECT Error: ".mysqli_error()); 
  
      print "&lt;table border=1&gt;\n"; 
      $row = mysqli_fetch_array($result);
      //To create field titles
      $arr = array_merge([ 0 =&gt; ['Name','Description','Price','Platform','Compatible','Type','Date Uploaded','Downloads','filename']],$row);
      foreach ($arr as $v){ 
      $files_field= $arr['filename'];
      $files_show= "uploads/$files_field";
      $namevalue= $arr['name'];
      $descriptionvalue = $arr['description'];
      $pricevalue = $arr['price'];
      $platformvalue = $arr['platform'];
      $compatiblevalue = $arr['compatible_devices'];
      $genrevalue = $arr['type'];
      $datevalue = $arr['date'];
      $downloadsvalue = $arr['downloads'];
      $filenamevalue = $arr['filename'];
  
      print "&lt;tr&gt;\n"; 
      print "\t&lt;td&gt;\n"; 
      echo "&lt;font face=arial size=4/&gt;$namevalue&lt;/font&gt;";
      print "&lt;tr&gt;\n"; 
      print "\t&lt;td&gt;\n"; 
      echo "&lt;font face=arial size=4/&gt;$descriptionvalue&lt;/font&gt;";
      print "&lt;tr&gt;\n"; 
      print "\t&lt;td&gt;\n"; 
      echo "&lt;font face=arial size=4/&gt;$pricevalue&lt;/font&gt;";
      print "&lt;tr&gt;\n"; 
      print "\t&lt;td&gt;\n"; 
      echo "&lt;font face=arial size=4/&gt;$platformvalue&lt;/font&gt;";
      print "&lt;tr&gt;\n"; 
      print "\t&lt;td&gt;\n"; 
      echo "&lt;font face=arial size=4/&gt;$compatiblevalue&lt;/font&gt;";
      print "&lt;/td&gt;\n";
      print "\t&lt;td&gt;\n"; 
      echo "&lt;font face=arial size=4/&gt;$genrevalue&lt;/font&gt;";
      print "&lt;/td&gt;\n";
      print "\t&lt;td&gt;\n"; 
      echo "&lt;font face=arial size=4/&gt;$compatiblevalue&lt;/font&gt;";
      print "&lt;/td&gt;\n";
      print "\t&lt;td&gt;\n"; 
      echo "&lt;font face=arial size=4/&gt;$datevalue&lt;/font&gt;";
      print "&lt;/td&gt;\n";
      print "\t&lt;td&gt;\n"; 
      echo "&lt;font face=arial size=4/&gt;$downloadsvalue&lt;/font&gt;";
      print "&lt;/td&gt;\n";
      print "\t&lt;td&gt;\n"; 
      echo "&lt;div align=center&gt;&lt;a href='$files_show'&gt;Download&lt;/a&gt;&lt;/div&gt;";
      print "&lt;/td&gt;\n";
      print "&lt;/tr&gt;\n"; 
      } 
      print "&lt;/table&gt;\n"; 
  
  
  ?&gt;
  
  </code></pre>