0

データベースから特定の営業担当者のデータを取得し、PDF ファイルでデータを取得するダウンロードを行いたいと考えています。誰か助けて

コードは次のとおりです。

 <?php

 include "test4.php";
 include('fpdf/fpdf.php');
 $pdf=new FPDF();

 //Creating new pdf page
 $pdf->AddPage();


  $pdf->SetRightMargin(50);
  $margin;

  // Insert a logo in the top-left corner at 300 dpi
  $pdf->Image('images/logo7.png',5,5,-100);
  // Insert a dynamic image from a URL
  $pdf->Ln(20);

  $pdf->Ln();
  //Set the base font & size
  $pdf->SetFont('Arial','B',18); 
  $pdf->Cell(200,5,"Booth Sales Reports",0,0,'C');
  //Creating new line
  $pdf->Ln();
  $pdf->Ln();
  $pdf->SetFont('Arial','i',12);
  $pdf->Cell(40,10,"Company Name",0,'C');
  $pdf->Cell(40,10,"Contact Person",0,'C');



 $pdf->Cell(40,10,"Booth Number",0,'C');

 $pdf->Cell(40,10,"Phone Number",0,'C');

 $pdf->Cell(30,10,"Date",0,'C');
 $pdf->Ln();
         $pdf->Cell(200,-2,"__________________________________");



   // Fetch data from table
     $c=$_SESSION['user'];
     $result=mysql_query("SELECT  `company_name`, `contact_person`,  `phone_number`, `booth_number`, `date` FROM `registration1` where 'sold_by' ='$c' ");
    while($row=mysql_fetch_array($result))
  {
  $pdf->Cell(40,5,"{$row['company_name']}",1,0,'C');
  $pdf->Cell(40,5,"{$row['contact_person']}",1,0,'C');




  $pdf->Cell(40,5,"{$row['phone_number']}",1,0,'C');

  $pdf->Cell(40,5,"{$row['booth_number']}",1,'C');

  $pdf->multiCell(30,5,"{$row['date']}",1,'C');
  }
 $pdf->Output();
  ?>

このコーディングは何も表示しません

4

2 に答える 2