Hi i Have been pulling my hair out over this for days and i was told the best php programmers are here so i hope someone can help me
i have this static code (works fine)
<?php
//this includes an external file with a script to dispaly this pages output as a pdf
include ('class.ezpdf.php');
//function to let the script know its a new pdf file and not an adition to an existing one
$pdf =& new Cezpdf();
//define the font to be used in the pdf
$pdf->selectFont('./fonts/Helvetica.afm');
//adds text with defined size on the pdf
$pdf->ezText(' personlized catalouge',12);
//a cheap way to add a new line :=)
$pdf->ezText(' ',12);
//this adds a table on to the pdf output the first value sets the coloum headder and then the value to be displayed in that coloum
$data =array(
array('id'=>'1','ptno'=>'111','Title'=>'sample titel','Description'=>'description here')
,array('id'=>'2','ptno'=>'112','Title'=>'sample titel','Description'=>'description here')
,array('id'=>'3','ptno'=>'113','Title'=>'sample titel','Description'=>'description here')
,array('id'=>'4','ptno'=>'114','Title'=>'sample titel','Description'=>'description here')
,array('id'=>'5','ptno'=>'115','Title'=>'sample titel','Description'=>'description here')
,array('id'=>'6','ptno'=>'116','Title'=>'sample titel','Description'=>'description here')
,array('id'=>'7','ptno'=>'117','Title'=>'sample titel','Description'=>'description here')
,array('id'=>'8','ptno'=>'118','Title'=>'sample titel','Description'=>'description here')
,array('id'=>'9','ptno'=>'119','Title'=>'sample titel','Description'=>'description here')
);
// lets the script know that the variable data contains the data fro the table generator for the pdf
$pdf->ezTable($data);
//command to submit and close the pdf creation document and display the output
$pdf->ezStream();
?>
however im trying to get the array to be pulled from a database
this is what i have tried
<?php
//includes the database connection information
include ('../include/database/config.php');
include ('../include/database/opendb.php');
//the sql query
$sql5 = "SELECT * FROM `products` LIMIT 1,5000";
//check the query works if not thouw up an error
$result5 = mysql_query($sql5) or die('Query 5 failed. ' . mysql_error());
//this includes an external file with a script to dispaly this pages output as a pdf
include ('class.ezpdf.php');
//function to let the script know its a new pdf file and not an adition to an existing one
$pdf =& new Cezpdf();
//define the font to be used in the pdf
$pdf->selectFont('./fonts/Helvetica.afm');
//adds text with defined size on the pdf
$pdf->ezText(' personlized catalouge',12);
//a cheap way to add a new line :=)
$pdf->ezText(' ',12);
//adding the first fixed line to get over the problem of not needing a , on the first aray item iknow ists a cheap way of gettign around this
$data =array(
array('id'=>'1','ptno'=>'111','Title'=>'sample titel','Description'=>'description here')
// the database query output durign the while statment it will get all the products and input the values needing into the aray
while($r5 = mysql_fetch_array($result5))
{
$id5=$r5["id"];
$ptno5=$r5["ptno"];
$title5=$r5["title"];
$fulldesc5=$r5["fulldesc"];
,array('id'=>'$id5','ptno'=>'$ptno5','Title'=>'$title5','Description'=>'$fulldesc5')
}
//close the array
);
// lets the script know that the variable data contains the data fro the table generator for the pdf
$pdf->ezTable($data);
//command to submit and close the pdf creation document and display the output
$pdf->ezStream();
?>
this give me an error.. i realize that the coding is wrong i just dont see the right way to do it .. any help with this will be appreciated
***edited to add the comment tags as suggested