Jump to content

TCPDF mysql query into table


honkmaster

Recommended Posts

Hi, i'm having a hard time with this one, I need to create a PDF with the results from a query into a html table, all I'm getting is the first row when I should get 6!! I'm quite new to TCPDF so any help would be great. Code below

$pdf = new TCPDF();	// add a page	$resolution= array(210, 297);	// set margins	$pdf->SetAutoPageBreak(false, 0);	$pdf->setCellMargins(0, 0, 0, 0);	$pdf->setCellPaddings(0, 0, 0, 0);		// remove default header/footer	$pdf->setPrintHeader(false);	$pdf->setPrintFooter(false);		// get data from users table 	$storeid  = $row_rsStoreID['Allocation_StoreId'];    $formcode = $row_rsStoreID['Allocation_FormCode'];    $qty =  $row_rsStoreID['Allocation_Quantity'];    $store = $row_rsStoreID['Allocation_Name'];	
// -----------------------------------------------------------------------------
$pdf->Write(10,10,0, 'Example of HTML tables', '', 0, 'L', true, 0, false, false, 0);
$pdf->SetFont('Helvetica', '', 12);
if($totalRows_rsStoreID > 0) {
while($row_rsStoreID = mysql_fetch_assoc($rsStoreID,MYSQL_ASSOC))
{
$tbl = <<<EOD
<table border="1" cellpadding="5" cellspacing="0">
<tr>
<td>$storeid</td>
<td>$formcode</td>
<td>$qty</td>
</tr>
</table>
EOD;
$pdf->writeHTML($tbl, true, false, false, false, '');
// -----------------------------------------------------------------------------

//Close and output PDF document $pdf->Output('Test', 'I');

Edited by honkmaster
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...