![]() |
Insert Values from DB into PDF form using TCPDF - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Insert Values from DB into PDF form using TCPDF (/showthread.php?tid=41463) |
Insert Values from DB into PDF form using TCPDF - El Forum - 05-09-2011 [eluser]Unknown[/eluser] Hello All, I am using TCPDF library to generate PDF. I have successfully used TCPDF using procedural PHP. However, I was developing same application using CI and TCPDF. Here is Controller Code: function index() ============== Model ============ Code: $this->db->select('table'); I am not sure what going wrong. When I load the page it shows me PDF with value as "Array" in table not employee id. I am trying to achieve is to get few values from table in DB and send it PDF (Id, Name, Address). It would be great if any one can please guide me through this problem. Thanks Insert Values from DB into PDF form using TCPDF - El Forum - 05-09-2011 [eluser]darrentaytay[/eluser] It's showing "Array" because your are trying to output an array. Try replacing Code: <td rowspan="3">$pdf_data</td> with Code: <td rowspan="3">$pdf_data['emp_id']</td> And see how that goes. Insert Values from DB into PDF form using TCPDF - El Forum - 05-09-2011 [eluser]Unknown[/eluser] Yes I treid that as well but it gives blank on output. However, I figure that out now. I was missing this part Code: $pdf_data = $this->create_pdf_model->get_details(); Code: $tbl = <<<EOD Now it works as excepted. Thanks for your prompt response... ![]() Insert Values from DB into PDF form using TCPDF - El Forum - 02-07-2012 [eluser]the_unforgiven[/eluser] Tried what you said pviral but getting this error Parse error: syntax error, unexpected $end in /Applications/MAMP/htdocs/ksd/application/controllers/admin.php on line 427 and this is because of the syntax used for <<<EOD it doesn;t work or the foreach loop is incoorect too, can you help me? Insert Values from DB into PDF form using TCPDF - El Forum - 02-07-2012 [eluser]the_unforgiven[/eluser] Anyone got any advice on this please? Insert Values from DB into PDF form using TCPDF - El Forum - 02-07-2012 [eluser]the_unforgiven[/eluser] anyone? |