$stmt = $conn->prepare($query);
if ($stmt->execute()) {
    $stmt->setFetchMode(PDO::FETCH_ASSOC);
}
while ($result = $stmt->fetch()) {
    $data[] = array($result['ComponentSpecs'], $result['Used_LineQuantity'], $result['Used_LineCost'], $result['Used_LineStatus'], $result['Used_LineDate'], $result['Used_LineSubTotal']);
}
date_default_timezone_set('America/Los_Angeles');
$pdf = new myPDF('L', 'mm', 'Letter');
$date = date("m/d/Y h:i A");
$pdf->date = $date;
$header1 = array('Usage Order #', 'Used By', 'For Tool', 'Date', 'Notes', 'Status');
$header = array('Component Used', 'Quantity Used', 'Cost', 'Status', 'Date Used', 'Subtotal');
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetY(35);
$pdf->BuildTable1($header1, $data1);
$pdf->SetY(55);
$pdf->BuildTable($header, $data);
$pdf->Ln(6);
$substring = " Total Subtotal: \$" . $subtotal . " ";
$substrwidth = $pdf->GetStringWidth($substring);
$substrX = 260 - $substrwidth;
$pdf->SetX($substrX);
$pdf->Cell($substrwidth, 6, $substring, 1, 1, 'C');
$tax = $subtotal * 0.075;
$tax = round($tax, 2);
$tax = number_format((double) $tax, 2, '.', '');
$taxstring = " Tax (7.5%): \$" . $tax . " ";
$taxstrwidth = $pdf->GetStringWidth($taxstring);
$taxstrX = 260 - $taxstrwidth;
 $pdf->AddPage();
 //Neue Seite Hinzufuegen
 $pdf->SetLeftMargin(20);
 //linker Rand 20 mm
 $pdf->SetAuthor("Mission-Net");
 $pdf->SetCreator("Mission-Net");
 $st_pdf_keywords = 'Reg.-No.: ' . $var_registrationnr;
 $pdf->SetKeywords($st_pdf_keywords);
 $pdf->SetSubject("Mission-Net Registration");
 $pdf->SetTitle("Registration for Mission-Net 2009");
 //######################HEADER###########
 //---------------------------------------
 //      Information und Logo
 //---------------------------------------
 //y-Position setzten
 $pdf->SetY(25);
 //Setzten des Teenstreets Logo
 $pdf->SetX(20);
 $pdf->Image("images/MN_Logo_kleiner.png", $pdf->GetX(), $pdf->GetY(), 60, 20, 'png', 'http://www.mission-net.org');
 //Zweites Logo
 $pdf->SetY(25);
 $pdf->SetX(135);
 $pdf->Image("images/MN_Logo_kleiner.png", $pdf->GetX(), $pdf->GetY(), 60, 20, 'png', 'http://www.mission-net.org');
 //Linie
 $pdf->setLineWidth(1);
 $pdf->Line(20, 45, 195, 45);
 //Cell, Anmeldung gueltig
 $pdf->SetY(50);
 $pdf->SetFont('Arial', 'B', 10);
 $pdf->Cell(0, 1, T_("Please print this page, sign it and send it to us, if you are under 18 years."), 0, 0, 'R');
 //#################HEADER END############