How to add my data from a database into a table?

Hey all,

This is a tad different from the usual insert…this script uses a class which creates a pdf using php…i want my data which is saved in a cookie and then saved into an array called $data…i want all the words in the $data array to appear in a table which is 4 columns by 5 rows.

Here is the code i have so far:


<?php

if (!isset($words) || strlen($words)==0){
//$demotext='demo text';

$words = explode( ',', $_COOKIE['cookie1'] );
$data = implode( ',', $words );

//$words = unserialize( $_COOKIE['cookie1'] );
//print $_COOKIE['cookie1'];

//print $data;
}

include ('class.ezpdf.php');
$pdf =& new Cezpdf();
$pdf->selectFont('./fonts/Helvetica.afm');
//this commented code below if uncommented will create a table with the //data that is handcoded in...i need my data to be loaded from the variable. //using that code below?
/*$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')
);*/
$pdf->ezTable($data);
$pdf->ezStream();
?>

Any ideas??

Cheers in advance peeps :smiley: