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 6742649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:52:07+00:00 2026-05-26T11:52:07+00:00

<?php require(‘mysql_report.php’); $checkbox = $_GET[‘checkbox’]; //geting Array of values from GET methode foreach ($checkbox

  • 0
<?php
require('mysql_report.php');
$checkbox = $_GET['checkbox'];
//geting Array of values from GET methode 
foreach ($checkbox as $value)
  {
    $sql="SELECT name,address,email,problem,reply_query FROM query where id = $value ";
    $result = mysql_query($sql);
    while($row = mysql_fetch_array($result)){

         }
    $pdf = new PDF('L','pt','A4');
    $pdf->SetFont('Arial','',12);
    $pdf->connect('localhost','uname','pwd','mydb');
    $attr = array('titleFontSize'=>18, 'titleText'=>'Report');

    $qry=$pdf->mysql_report($sql,false,$attr);
    }       
$pdf->Output();
?>

here is the code i got the array of values from $_GET[‘checkbox’]; how i got the pdf while the selected check boxes

  • 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-26T11:52:07+00:00Added an answer on May 26, 2026 at 11:52 am

    You have placed the pdf generation code inside the foreach loop. It should be outside.
    Try this:

    $sql="SELECT name,address,email,problem,type,other,reply_query FROM query where";
    $i = 1;
    foreach ($checkbox as $value)
    {
                        if($i<count($checkbox))
                        {
                        $sql=$sql." id = \"".$value."\" OR";
                        $i++;
                        }
                        else
                        {
                        $sql=$sql." id = \"".$value."\"";
                        }
    }       
    
        $pdf = new PDF('L','pt','A4');
    
        $pdf->SetFont('Arial','',12);
        $pdf->connect('localhost','root','asdfgh','Tree_help');
        $attr = array('titleFontSize'=>18, 'titleText'=>'Treehealth Report');
        $qry=$pdf->mysql_report($sql,$dump=false,$attr=array());        
        $pdf->Output();
    

    This should give you the correct output 🙂

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

Sidebar

Related Questions

Please see this below PHP code: <?php require '../src/facebook.php'; $facebook = new Facebook(array( 'appId'
I want to get json with php encode function like the following <?php require
Is it possible to have php not to require the begin/end tags ( <?php
Why does PHP require you to explicitly write $this ? I would understand if
I've got a file header.php which is require()'d in just about every file within
I've never seen anything like this. File structure: somefolder/base.php includes/stuff.php includes/constants.php base.php: <?php require(../includes/stuff.php);
i have a script like this : <html> <body> <?php require("wrongFile.php"); echo "Hello World!";
I know the basic usage of PHP require, require once, include and include once.
<?php //require 'includes/db.inc.php'; require 'includes/configs.inc.php'; ?> <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd>
lets say we have a directory. project/index.php in index.php <?php require 'config/config.php'; echo ROOTPATH;

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.