Help Please! PHP CODE data from mysql to PDF output to print

i want to create a C.O.R(Certifiate of registartion) and class schedule into PDF format to print by the student…but i dont have idea… my problem is how to get the data where insert by the student in the register form then come out in pdf to print serve as their C.O.R. :confused:…all information that they insert into the register form will need to come out in pdf. i dont know how to start this coding. using PHP language…

Hi,
You can get those data (from form with $_POST[‘field_name’] , or from mysql table with SELECT), then creade in php a html document wirh those data , and use “dompdf class” to convert html to pdf.
dompdf is free on the net.

This will create a pdf but might be a bit to complicated for you to start out with: http://www.fpdf.org/
Why does the output need to be a pdf?

for a student purpose… for a online enrollment system …

can u help me?

First, you need to query the student first

$sql = “SELECT * FROM student_tbl WHERE student_id=$id and school_year=$sy and term=$term”;

Then try to use either of this library:
http://www.tcpdf.org/docs.php

But if I were you, use the fpdf because it is much simpler and easy to use.

thnx alot

mysql_connect(‘localhost’,‘root’,‘’);
mysql_select_db(‘db_enrollment’);

<?php
require(‘fpdf.php’);

class PDF extends FPDF
{
// Page header
function Header()
{
// Logo
$this->Image(‘logo.jpg’,22,10,160);
// Arial bold 15
$this->SetFont(‘Arial’,‘B’,15);
// Move to the right
$this->Cell(80);

// Line break
$this-&gt;Ln(20);

}

$result=mysql_query(‘select * from student’);

// Page footer
function Footer()
{
// Position at 1.5 cm from bottom
$this->SetY(-15);
// Arial italic 8
$this->SetFont(‘Arial’,‘I’,8);

}
}

$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->Output();

?>

ERROR on line 25 >.< “$result=mysql_query(‘select * from student’);” this one