title: While loop in FPDF
body: <p>I'm having some trouble getting a SQL query to work inside fpdf, is this even possible?</p>
  
  <p>I currently have </p>
  
  <pre><code>session_start();
  require('fpdf.php');    
  class PDF extends FPDF
  {
      function Header()
          {
              include('config.php');
              $client_check = $db-&gt;prepare("SELECT * FROM clients WHERE client_fullname = '".$_SESSION['client_details']."'");
              $client_check-&gt;execute();
              while ($row = $client_check-&gt;fetch(PDO::FETCH_ASSOC))
              {
                  $client_firstname    = $row ['client_firstname'];
                  $client_lastname     = $row ['client_lastname'];
                  $client_address      = $row ['client_address'];
                  $client_jobaddress   = $row ['client_jobaddress'];
                  $client_homephone    = $row ['client_homephone'];
  
                  $this-&gt;SetFont('Arial', 'B', 12);
                  $this-&gt;Cell(10,0,'Ph(H):',0,0,'C');
                  $this-&gt;Cell(20,0,''.$client_homephone.'', 0,0,'C');
                  $this-&gt;Line(30,61,100,61);
                  $this-&gt;Cell(210,0,'Job No:',0,0,'C');
                  $this-&gt;Cell(-120,0,'Model:',0,0,'C');
                  $this-&gt;Line(110,61,200,61);
              }
          }
      }
  // Instanciation of inherited class
  $pdf = new PDF();
  $pdf-&gt;AliasNbPages();
  $pdf-&gt;AddPage();
  $pdf-&gt;SetFont('Times','',10);
  $pdf-&gt;Output();
  </code></pre>
  
  <p>Everything worked nicely before I added the while loop. Now it just spits out a blank pdf to me. How can I fix this?</p>