title: unable to download file from my mysql database
body: <p>I'm trying to download file from MySQL server, but am not able to do so.</p>
  
  <p>The script executes but it can download only the first 65 KB of the file.</p>
  
  <pre><code>&lt;?php
      include('connect.php');
      if(isset($_GET['id']))
      {
          $id = $_GET['id'];
          $query = "SELECT * FROM upload WHERE id = '$id'";
          $result  = mysqli_query($connection,$query) or die(mysql_error());
          while($row = mysqli_fetch_assoc($result))
          {
              $name=$row['name'];
              $size=$row['size'];
              $type=$row['type'];
              $content=$row['content'];
          }
          header("Content-disposition: attachment; filename=$name");
          header("Content-length: $size");
          header("Content-type: $type");
          echo $content;
      } else {
          die("No file id given...");
      }
      unset($_GET['id']);
  ?&gt; 
  </code></pre>