PHP to PDF with Oracle Database

I never think that PHP can do this. It’s still about my database labwork. Yesterday, I’ve got a problem with creating a report from PHP. And then I asked my friend, Wima because I had to finish web engine for my application. We have the same project so we divided it into two parts. He made the report and I handled the PHP web engine.First, a trying to create an excel document from PHP failed. We couldn’t debug where is the error although didn’t sleep for a long long night. In the next day, Wima tried to open sample application in XAMMP at localhost. We used XAMMP bundle where Apace, PHP, and MySQL integrated here. Wanna know the code? We still used Oracle as database. Here’s the code: //connection to Oracle include (’koneksi.php’); //query $query = “select no_kamar_inv , kamar_jenis_inv,kamar_kategori,kamar_harga from kel65_inventaris_kamar order by no_kamar_inv”; $stmt = ociparse($c,$query); ociexecute($stmt,OCI_DEFAULT); //php class to create pdf include (’class.ezpdf.php’); $pdf = new Cezpdf(); $pdf->selectFont(’../../php/extras/pdf-related/Helvetica.afm’); $pdf->ezText(’Laporan Data Kamar’,14); $pdf->ezText(’Sistem Informasi E-Inap’,10); $pdf->ezText(”,12); $i=0; while ($row=oci_fetch_array($stmt)) $pdf->ezTable($data,”",”",array(’width’=>500)); $pdf->ezStream(); exit;How to connect to Oracle is described in article PHP Connection to Oracle. (http://studiawan.blogspot.com/2007/06/php-connection-to-oracle.html)You will find some different things here if you use another version of XAMMP. But don’t worry, it’s just a little bit different. Have a nice try with PHP PDF report…Special thanks for WimaRead more at: Knowledge to Share (http://studiawan.blogspot.com/2007/07/php-to-pdf-with-oracle-database.html)

If you like this post, you can subscribe to receive latest posts by e-mail or RSS feed.

Some people come to this post with this search term:

And here is the related entries of this post: Live Webfast of the Oracle Database 11g (taken from Oracle newsletter), Splitting Oracle Server, Host Credentials of Your Oracle: Hmmm…, Database name list in Toad, Oracle System Account is Locked,

Leave a Reply