title: How to use the PHP script in TCPDF?
body: <p>I have a table in Database like this</p>
  
  <pre><code> expedition_name | Phone | CP    |
  __________________________________________
      Starsindo    | 09890 | John  |
      Iron Bird    | 09891 | Gina  |
      MSA Cargo    | 09890 | John  |
  </code></pre>
  
  <p>Now I will create the PDF from that table with TCPDF using HTML function.</p>
  
  <p>But I Still confuses how to combine that
  my code like this</p>
  
  <pre><code>  &lt;?php
  
  require_once('tcpdf/config/lang/eng.php');
  require_once('tcpdf/tcpdf.php');
  
  // create new PDF document
   include "koneksi.php";
     $sql = "SELECT * FROM tb_exp_local";
     $hasil = mysql_query($sql);
     $data = mysql_fetch_array($hasil);
  
     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
  
     // set font
     $pdf-&gt;SetFont('times', '', 11);
  
     // add a page
     $pdf-&gt;AddPage();
  
  
  
     $html = '&lt;h2&gt;List Of Expediton&lt;/h2&gt;    //Title
  &lt;table border="1" cellspacing="3" cellpadding="4"&gt;
      &lt;tr&gt;
          &lt;th&gt;Expedition&lt;/th&gt;                //head of column name
          &lt;th align="center"&gt;Phoine&lt;/th&gt;  //head of column name
          &lt;th align="center"&gt;CP&lt;/th&gt;       //head of column name
      &lt;/tr&gt;
       while($data=mysql_fetch_array($hasil))
       { 
      &lt;tr&gt;
         &lt;td&gt;$data[nama_exp]&lt;/td&gt;
      &lt;/tr&gt;
       }   
  &lt;/table&gt;';
  
  
    $pdf-&gt;writeHTML($html, true, false, true, false, '');
  
  
     $pdf-&gt;Output('Local Expedition, 'I');
  
  ?&gt;
  </code></pre>
  
  <p>Can Anyone help me, How to fix it? and the data can be write in PDF?</p>