1

Hi there!
I would like ask if is posible generate pdf from php file for example:
[code]
<?php
mysql_connect('localhost','user','pass');
mysql_select_db('data_base');
$result = mysql_query('select * from tabele');
while ($row = mysql_fetch_assoc($result)) {
echo $row["id_table"];
echo $row["table_value"];
}
mysql_free_result($result);
?>
[/code]

2

3

This:

<?php
$content = "
<page>
<h1>Exemple d'utilisation</h1>
<br>
Ceci est un <b>exemple d'utilisation</b>
de <a href='http://html2pdf.fr/'>HTML2PDF</a>.<br>
</page>";

require_once(dirname(__FILE__).'/html2pdf.class.php');
$html2pdf = new HTML2PDF('P','A4','fr');
$html2pdf->WriteHTML($content);
$html2pdf->Output('exemple.pdf');
?>

Work correctly but this:

<?php
$content = "
mysql_connect('localhost','test','test1');
mysql_select_db('scieki');
$result = mysql_query('select * from kody');
while ($row = mysql_fetch_assoc($result)) {
$row['kod_odp'];
}
mysql_free_result($result);
";



require_once(dirname(__FILE__).'/html2pdf.class.php');
$html2pdf = new HTML2PDF('P','A4','fr');
$html2pdf->WriteHTML($content);
$html2pdf->Output('exemple.pdf');
?>

Not! I have error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\htdocs\pdf\test.php on line 7

4

just learn about how is working PHP wink

your pb is not about HTML2PDF. It is about basic PHP...
Ancien pseudo : lolo