TCPDF and Loop
Posted: Tue Apr 12, 2011 10:47 am
Hi
I am trying to work out how to add a loop statement to my pdf generation (I think that's what I need).
I have a mysql table - events with 3 fields - id, name and date.
In my php page which is to generate the pdf I have:
mysql_select_db($database_events, $events);
$result = mysql_query("SELECT id, date, name
FROM events_pbw
WHERE id>200
");
while($row = mysql_fetch_array($result))
{
$id = $row['id'];
$date = $row['date'];
$name = $row['name'];
}
and in amongst the $html part of the page I have:
$html ="<html>
$id<br>
$name<br>
$date<br>
<i>This is a test calendar.</i>
This all works fine but (obviously) just gives one result. What do I need to add to make it list out all of the possible events?
Many thanks in advance.
I am trying to work out how to add a loop statement to my pdf generation (I think that's what I need).
I have a mysql table - events with 3 fields - id, name and date.
In my php page which is to generate the pdf I have:
mysql_select_db($database_events, $events);
$result = mysql_query("SELECT id, date, name
FROM events_pbw
WHERE id>200
");
while($row = mysql_fetch_array($result))
{
$id = $row['id'];
$date = $row['date'];
$name = $row['name'];
}
and in amongst the $html part of the page I have:
$html ="<html>
$id<br>
$name<br>
$date<br>
<i>This is a test calendar.</i>
This all works fine but (obviously) just gives one result. What do I need to add to make it list out all of the possible events?
Many thanks in advance.