title: Having an Issue Displaying from Database Using Select, PHP, FPDF
body: <p>I'm having an issue with displaying information from a database using a select statement in a FPDF file. I've created two files. The first file, the user inputs the DonorID and hits create invoice. The file points to the fpdf file that goes and creates a pdf file and displays an invoice. It has a select statement that doesn't seem to be generating any results. Everything else displays properly, but the table is not displaying any information from the database.</p>
  
  <p>Here is the first file, called createinvoice.php:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;title&gt; Create Invoice Page&lt;/title&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;Create Invoice&lt;/h1&gt; 
      &lt;form action="invoicereportpdf.php" method="POST"&gt;
      &lt;p&gt;Create an invoice by typing in the Donor ID&lt;/BR&gt;
      Donor ID: &lt;input type= "text" name="donorid" size="15"/&gt;&lt;/br&gt;
  
      &lt;br&gt;
      &lt;div id="container" style="width:900px"&gt;
          &lt;br&gt;
          &lt;input type= "submit" name= "submit" value="Create Invoice"/&gt;
  
          &lt;?php include '/html/includedonations.php'; ?&gt; 
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is the second file that is called by the first one called invoicereportpdf.php</p>
  
  <pre><code>&lt;?php
  define('FPDF_FONTPATH','font/');
  require('mysql_table.php');
  
  class PDF extends PDF_MySQL_Table
  {
      function Header()
      {
          //Title
          $this-&gt;SetFont('Arial','',14);
          $this-&gt;Cell(0,6,'Invoice',0,1,'C');
          $this-&gt;Ln(10);
          $this-&gt;Cell(0,6,'From',0,1,'C');
          $this-&gt;Ln(12);
          $this-&gt;Cell(0,6,'Vetsports.org',0,1,'C');
          $this-&gt;Ln(14);
          $this-&gt;Cell(0,6, 'Thank you for your donation to Vetsports.org, your 
          donation is greatly appreciated.',0,1,'L');
          $this-&gt;Ln(16);
          $this-&gt;Cell(0,6, 'Please keep this receipt for your tax 
          purposes.',0,1,'L');
          $this-&gt;Ln(16);
          //Ensure table header is output
          parent::Header();
      }
  }
  
  //Connect to database
  mysql_connect('localhost','root','');
  mysql_select_db('charitabledb');
  
  $donorid=$_POST['donorid'];
  
  $pdf=new PDF();
  $pdf-&gt;Open();
  $pdf-&gt;AddPage();
  //table: specify 4 columns
  $pdf-&gt;AddCol('ID',15,'ID','C');
  $pdf-&gt;AddCol('date',15,'Date','C');
  $pdf-&gt;AddCol('donorid',25,'Donor ID','C');
  $pdf-&gt;AddCol('firstname',25,'First Name','L');
  $pdf-&gt;AddCol('lastname',25,'Last Name','L');
  $pdf-&gt;AddCol('paymenttype',35,'Payment Type','L');
  $pdf-&gt;AddCol('organization',30,'Organization','L');
  $pdf-&gt;AddCol('Income',40,'Amount Donated','L');
  $prop=array('HeaderColor'=&gt;array(255,150,100),
  'color1'=&gt;array(210,245,255),
  'color2'=&gt;array(255,255,210),
  'padding'=&gt;2);
  $pdf-&gt;Table('select ID,date,donorid,firstname,lastname,paymenttype,organization,Income from donations where donorid="$donorid" order by date ',$prop);
  
  $pdf-&gt;Output();
  ?&gt; 
  </code></pre>