Actually I'm new to TCPDF. Can anyone help me to display the data as a .pdf file. I am using the following code and the data is being displayed as a general webpage. I want to display it in .pdf format.
require_once('../config/lang/eng.php')
require_once('../tcpdf.php')
error_reporting(E_ALL) ; ini_set('display_errors', '1');
$con=mysql_connect("localhost","root","");
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("ef_kabaadkhana");
$result = mysql_query("SELECT form_id,partner_name FROM ef_form_master_v1");
if (($result))
{
echo "<table width='100%'><tr>";
if (mysql_num_rows($result)>0)
{
$i = 0;
while ($i < mysql_num_fields($result))
{
echo "<th>". mysql_field_name($result, $i) . "</th>";
$i++;
}
echo "</tr>";
while ($rows = mysql_fetch_array($result,MYSQL_ASSOC))
{
echo "<tr>";
foreach ($rows as $data)
{
echo "<td align='center'>". $data . "</td>";
}
}
}else{
echo "<tr><td colspan='" . ($i+1) . "'>No Results found!</td></tr>";
}
echo "</table>";
}else{
echo "Error in running query :". mysql_error();
}