Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5959139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:38:36+00:00 2026-05-22T18:38:36+00:00

I have already created a report using list of data from my database. i

  • 0

I have already created a report using list of data from my database. i have a button in that page “Click to generate Pdf”. if i click that button the same report have to come as pdf report. now i need to convert that reports as PDF. i have googled past some days but i couldn’t find the answers. all are saying and giving values directly into tables and they were generated it. But I need retrieve it directly from my database. i wanna to get it directly from queries….

If any one know means kindly give your answers. hope you guys got my ques..

Thanks in Advance.

Update : here is my script pdf.php

<?php
include ('connection.php');
require('fpdf.php');

$joined = $_GET['joined'];
list($ZoneNo, $InstituteNo, $Year) = split('[,]', $joined);
//echo "ZoneNo: $ZoneNo; Institute: $InstituteNo; Year: $Year<br />\n";

$pdf=new FPDF();
$pdf->AddPage();

$pdf->SetFont('Arial','B',10);

$pdf->Ln();
$pdf->Ln();

$pdf->SetFont('Arial','B',10);
$pdf->Cell(20,15,"No");
$pdf->Cell(50,15,"Institute Name");
$pdf->Cell(50,15,"Course Name");
$pdf->Cell(50,15,"No. Of Students");
$pdf->Cell(50,15,"Year");
$pdf->Ln();
$pdf->Cell(450,3,"--------------------------------------------------------------------------------------------------------------------------------------------------------");


        $sql = "SELECT im.InstituteName,cm.CourseName,COUNT(sm.CourseNo),sm.Year FROM student_master sm,course_master cm,institute_master im WHERE ((sm.Year='".$Year."') AND (sm.InstituteNo='".$InstituteNo."') AND (sm.ZoneNo = '".$ZoneNo."')) AND (im.InstituteNo = sm.InstituteNo) AND (cm.CourseNo = sm.CourseNo) GROUP BY sm.CourseNo ORDER BY im.InstituteName,cm.CourseName";
        $result = mysql_query($sql);
        $No = 0;
        while($rows=mysql_fetch_array($result))
        {
            $No = $No + 1;
            $InstituteName = $rows[0];
            $CourseName = $rows[1];
            $Total = $rows[2];
            $Year = $rows[3];
            $pdf->Cell(20,15,"{$No}");
            $pdf->Cell(50,15,"{$InstituteName}");
            $pdf->Cell(50,15,"{$CourseName}");
            $pdf->Cell(50,15,"{$Total}");
            $pdf->Cell(50,15,"{$Year}");    
        }

$pdf->Output();

?>

note you guys here am getting only the output as

No InstituteName Course name No. of students Year

can you explain it now guys????

Guys Check this link http://www.fpdf.de/downloads/addons/30/ if you have problems

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:38:37+00:00Added an answer on May 22, 2026 at 6:38 pm

    try FPDF liberary as mentioned by diEcho above. You can find the Tutorials on their website. Here’s a complete example of exporting data from mysql using the FPDF:

    http://www.fpdf.de/downloads/addons/30/

    Also here:
    http://www.weberdev.com/get_example-3720.html

    Hope it helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem using HtmlDataTable for viewing data from database. When I create
I have an access 2007 Database that outputs a report in excel format, the
How can I embed my listview in a layout that I have already created?
I have a repository which I have already cloned from Subversion. I've been doing
I have a ProgressBar that uses the marquee style when a report is being
I have a page that uses Ryan Bates nested_form plugin . The plugin is
I'm new to Eclipse/Java/Android I have already created this project, but I wanted to
I have recently started work on a project that has already been running for
I have a GridView with one ButtonField column like this: I have already Created
I have a form which will generate a report for mailing. The form opens

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.