Hey guys, I am trying to use EZPDF to create dynamic reports on the fly.
My question is how do you do this using dynamic data?
Here is a sample of the code to do it manualy...
$data = array(
array('num'=>1,'name'=>'gandalf','type'=>'wizard')
,array('num'=>2,'name'=>'bilbo','type'=>'hobbit','url'=>'http://www.ros.co.
nz/pdf/')
,array('num'=>3,'name'=>'frodo','type'=>'hobbit')
,array('num'=>4,'name'=>'saruman','type'=>'bad
dude','url'=>'http://sourceforge.net/projects/pdf-php')
,array('num'=>5,'name'=>'sauron','type'=>'really bad dude')
);
This prints out just fine. However, like I said, I am trying to make a dynamicaly created array from a Mysql Table.
Here is an example of how I would do that..
$data = array(
for($i=0; $i<$numRows; $i++){
$anyRow = $db->getAnyRow($i);
$jobNumber = $anyRow['JobNumber'];
$customerName = $anyRow['PrimaryName'];
$make =$anyRow['Make'];
$model = $anyRow['Model'];
array('RO#'=>$jobNumber,'CustomerName'=>$customerName,'Make'=>$make,'Model'=>$model),
}//end for
);
But of course that doesn't work.
Anyone have any ideas?
Thanks!