TCPDF repeating mysql data in pdf page generated


I have a site which has calendar events entered into a table - events_pbw. Amongst other fields it has - id, date, name.

I wish to produce a pdf showing all future events and this will then be emailed to those interested. Within the pdf generation page (calendar.php) I have:

// get data from events_pbw table
$result = mysql_query(“SELECT id, date, name
FROM events_pbw
WHERE date > 2011-01-01”

while($row = mysql_fetch_array($result))
$appid = $row[‘id’];
$date = $row[‘date’];
$name = $row[‘name’];

and within the pdf generation part I have:


This prints OK but there is just the first item listed and I’m not sure how the listing can be completed to list all items that meet the criteria.

I’ve tried various things but they all fail! Does anyone have any ideas please?

Many thanks.