views:

60

answers:

1

Hi I am exporting data from php page to word,, there i get 'n' number of datas in each page .... How to set the maximum number of data that a word page can contain ,,,, I want only 20 datas in a single page

This is the coding i use to export the data to word

In mysql_table.php the table for the pdf document is be generated

<?php
require('mysql_table.php');

class PDF extends PDF_MySQL_Table
{
function Header()
{
    //Title
    $this->SetFont('Arial','',18);
    $this->Cell(0,6,'Country details',0,1,'C');
    $this->Ln(10);
    parent::Header();
}
}

//Connect to database
mysql_connect('localhost','root','');
mysql_select_db('cms');

$pdf=new PDF();
$pdf->AddPage();
//First table: put all columns automatically
$pdf->Table("SELECT 
                (SELECT COUNT(*) FROM tblentercountry t2 WHERE t2.dbName <= t1.dbName and dbIsDelete='0') 
                AS SLNO ,dbName as Namee,t3.dbCountry as Country,t4.dbState as State,t5.dbTown as Town
                FROM tblentercountry t1 
                join tablecountry as t3,
                tablestate as t4,
                tabletown as t5
                where t1.dbIsDelete='0'
                and t1.dbCountryId=t3.dbCountryId
                and t1.dbStateId=t4.dbStateId
                and t1.dbTownId=t5.dbTownId
                order by dbName");
$pdf->AddPage();
//Second table: specify 3 columns
$pdf->AddCol('rank',20,'','C');
$pdf->AddCol('name',20,'tablecountry');
$pdf->AddCol('pop',20,'Pop (2001)','R');
$prop=array('HeaderColor'=>array(255,150,100),
            'color1'=>array(210,245,255),
            'color2'=>array(255,255,210),
            'padding'=>2);
//$pdf->Table('select dbCountry,dbCountryId from tablecountry  limit 0,10',$prop);
$pdf->Output();
?>

How to limit the number of datas in a page

+1  A: 

LIMIT

eh? maybe?

http://dev.mysql.com/doc/refman/5.0/en/limit-optimization.html

stormdrain