EZPDF and MYSQL |
![]() ![]() |
EZPDF and MYSQL |
Nov 4 2009, 02:33 AM
Post
#1
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 7,885 Joined: 23-November 08 Member No.: 6,521 |
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... PHP Code: $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.. PHP Code: $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! |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 21st November 2009 - 07:03 PM |