मैं अब मैं एचटीएमएल समारोह का उपयोग कर TCPDF साथ उस तालिका से पीडीएफ पैदा करेगा इसटीसीपीडीएफ में PHP स्क्रिप्ट का उपयोग कैसे करें?
expedition_name | Phone | CP |
__________________________________________
Starsindo | 09890 | John |
Iron Bird | 09891 | Gina |
MSA Cargo | 09890 | John |
तरह डाटाबेस में एक मेज है।
लेकिन मैं अभी भी भ्रमित गठबंधन करने के लिए कैसे है कि इस
<?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->SetFont('times', '', 11);
// add a page
$pdf->AddPage();
$html = '<h2>List Of Expediton</h2> //Title
<table border="1" cellspacing="3" cellpadding="4">
<tr>
<th>Expedition</th> //head of column name
<th align="center">Phoine</th> //head of column name
<th align="center">CP</th> //head of column name
</tr>
while($data=mysql_fetch_array($hasil))
{
<tr>
<td>$data[nama_exp]</td>
</tr>
}
</table>';
$pdf->writeHTML($html, true, false, true, false, '');
$pdf->Output('Local Expedition, 'I');
?>
किसी को भी मेरी मदद कर सकते की तरह मेरे कोड, कैसे इसे ठीक करने के? और डेटा पीडीएफ में लिखा जा सकता है?
और त्रुटि/समस्या क्या है? आपके उत्तर दोस्त के लिए – k102