title: Fetch Data from Mysql in php on pdf using fpdf
body: <p>I am new in php, and using first time FPDF for generating pdf file.<br>
  I have a database with name <code>test123</code> and table with named <code>form</code> having four fields
  <code>id</code> with data type int,
  <code>Name</code>, <code>Address</code> and <code>Designation</code> with data type Varchar, and the last one is Text with data type longblob.</p>
  
  <p>Data inserted in these fields by a form having textarea. </p>
  
  <p>Problem is that when I want to generate pdf file and import data from database data type blob is not converted. Here is screenshot of my problem just click on the link <a href="http://postimg.org/image/qtid90tqb/" rel="nofollow">http://postimg.org/image/qtid90tqb</a>/</p>
  
  <p>Below is the code I am using:</p>
  
  <pre><code>&lt;?php 
  require('fpdf/fpdf.php');
  
  //create a FPDF object
  $pdf=new FPDF(); 
  
  //set font for the entire document
  $pdf-&gt;SetFont('Helvetica','B',20);
  //$pdf-&gt;SetTextColor(50,60,100);
  
  //set up a page
  $pdf-&gt;AddPage('P'); 
  $pdf-&gt;SetDisplayMode('default');
  
  //insert an image and make it a link
  $pdf-&gt;Image('image/logo.gif',100,10,20,0);
  
  //display the title with a border around it
  $pdf-&gt;SetXY(40,30);
  $pdf-&gt;SetDrawColor(50,60,100);
  $pdf-&gt;Write(10,'The Pakistan Credit Rating Agency Limited',0,'C',0);
  $pdf-&gt;Line(10,40,200,40);
  
  //Set x and y position for the main text, reduce font size and write content
  $pdf-&gt;SetXY (20,45);
  $pdf-&gt;SetFontSize(10);
  $pdf-&gt;SetTextColor(30,30,100);
  $pdf-&gt;Write(5,'NL FYI s-l4l (PSO-040515)');
  
  $host="localhost"; // Host name 
  $username="root"; // Mysql username 
  $password=""; // Mysql password 
  $db_name="test123"; // Database name 
  $tbl_name="form"; // Table name
  
  $con = mysqli_connect('localhost','root','');
  mysqli_select_db($con,"test123");
  
  $sql="SELECT * FROM form WHERE id = '30'";
  $result = mysqli_query($con,$sql);
  while($rows= (mysqli_fetch_array($result,MYSQLI_ASSOC)))
  {           
      $name = $rows['Name'];
      $address = $rows['Address'];
      $class = $rows['Designation'];
      $phone = $rows['Text'];
  
      $pdf-&gt;SetXY (20,60);
      $pdf-&gt;SetFontSize(12);
      $pdf-&gt;SetTextColor(0,0,0);
      $pdf-&gt;Write(7,$name);
      $pdf-&gt;SetXY (20,65);
      $pdf-&gt;Write(7,$address);
      $pdf-&gt;SetXY (20,70);
      $pdf-&gt;Write(7,$class);
      $pdf-&gt;SetXY (20,90);
      $pdf-&gt;Write(7,$phone);
      $pdf-&gt;Ln(); 
  }
  
  //Output the document
  $pdf-&gt;Output('test.pdf','I');     
  ?&gt;
  </code></pre>