Jump to content


This topic is now archived and is closed to further replies.


fpdf problem

Recommended Posts

Anyone know how to arrange the results into two columns ? i tried but i only manage to display the result in one column, thanks.

I want to display the results into pdf file in 2 columns, for example the $sql returns 10 records, i want each column have 5 records. thanks.


$start1 = $_GET[s];
$end1 = $_GET[e];

$con3 = " AND card_trans.DateCreate BETWEEN '$start1' AND '$end1'";
$sql = $db->Prepare("SELECT * FROM member_details,card_trans
WHERE member_details.MemberID=card_trans.MemberID
AND card_trans.TransStatus='A' $con3 ");
$rs = $db->Execute($sql);
$total = $rs->RecordCount();

$code = $rs->fields["MemberFullName"];

$a= $rs->fields["MemberAddress"];
$b= $rs->fields["MemberPostcode"];
$code2 = $a."\n".$b;

$code3 = $code."\n".$code2;

$column_code = $column_code.$code3."\n\n";

//Create a new PDF file
$pdf=new FPDF();

//Fields Name position
//$Y_Fields_Name_position = 10;
//Table position, under Fields Name
$Y_Table_Position = 10;

//Now show the 2 columns



Share this post

Link to post
Share on other sites
this is my script for doing what you want... cant remember where i got it from... its a bit rough, but it works.

$bareQuery = "SELECT * FROM your_table";
$queryall = $bareQuery.$sorted;
$resultall = MYSQL_QUERY($queryall);
$numberall = mysql_Numrows($resultall);

if ($numberall==0) {
echo "No Results Found !";
else if ($numberall>0) {
while ($x<$numberall)
if (($x%3)==0) { $row="</tr><tr><td class=report>"; } else { $row="<td>"; }


<? echo $row ?>




} // end while
} // end if numberall > 0

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.