php - HTML to PDF , Result columns are empty -
i using following codes create pdf.
first memberinfo.php page contains table name, address, city etc of member mysql database. file in www.example.com/admin folder
second member_pdf.php it used create pdf. in www.example.com/admin/do-pdf/dompdf/ folder
code in memberinfo.php :
<? include("../include/function.php"); // connect database // create object class $bsq=new bsq(); //use class function connect database $bsq->connect_db(); //================================================================================= $reg_id=$_get["reg_id"]; $where="reg_id='".$_get["reg_id"]."'"; $web_datars=$bsq->webdreamselect('tablename',$where,'','','',''); $member_data=mysql_fetch_array($web_datars); ?> //this table shown when click on view details link on member's list page... <table> <tr> <td> name </td><td><?=$member_data['name'];?></td> <td> address </td><td><?=$member_data['address'];?></td> .. .. .. </tr> </table>
code in member_pdf.php :
<?php require_once("dompdf_config.inc.php"); ob_start(); //be sure file exists, , works outside of web context etc.) require("http://example.com/admin/memberinfo.php"); $dompdf = new dompdf(); $dompdf->load_html(ob_get_clean()); $dompdf->render(); $dompdf->stream("file.pdf"); ?>
now problem , pdf created table tds containing $member_data['name'] , $member_data['address'] etc empty.....
see image =
Comments
Post a Comment