[eluser]Nicemotion[/eluser]
Just realized i posted in a solved thread... re-post as new topic here...
Dear all,
All works perfectly but the dynamic data (lol).. it gives me a sintax T_STRING error in the query echo lines tho the html is correct on a normal html page...
Any idea ?
Ty in advance
Code:
<?php
require_once('Connections/tao_conn.php');
mysql_select_db($database_tao_conn, $tao_conn);
$query_Pagamenti = "SELECT * FROM pagamenti INNER JOIN iscrizioni ON pagamenti.iscrizioni_idiscrizioni = iscrizioni.idiscrizioni INNER JOIN utenti ON iscrizioni.utenti_idutenti = utenti.idutenti LEFT JOIN fatture_has_pagamenti ON fatture_has_pagamenti.pagamenti_idpagamenti = pagamenti.idpagamenti LEFT JOIN fatture ON fatture.utenti_idutenti = iscrizioni.utenti_idutenti INNER JOIN diz_iva ON diz_iva.iddiz_iva = fatture.diz_iva_iddiz_iva WHERE iscrizioni.utenti_idutenti = utenti.idutenti";
$Pagamenti = mysql_query($query_Pagamenti, $tao_conn) or die(mysql_error());
$row_Pagamenti = mysql_fetch_assoc($Pagamenti);
$totalRows_Pagamenti = mysql_num_rows($Pagamenti);
require_once("resources/dompdf/dompdf_config.inc.php");
$filename = "pdf_test";
$html ='<html><body>'.
'<table width="100%" border="0">
<tr>
<td>ID Pago</td>
<td>Importo</td>
<td>Data</td>
<td>Descrizione</td>
<td>IVA %</td>
<td>IVA</td>
</tr>
<?php do { ?>
<tr>
### following 5 lines gives problem ###
<td><?php echo $row_Pagamenti['idpagamenti']; ?></td>
<td><?php echo $row_Pagamenti['pagatoimporto']; ?></td>
<td><?php echo $row_Pagamenti['pagatodata']; ?></td>
<td><?php echo $row_Pagamenti['descpago']; ?></td>
<td><?php echo $row_Pagamenti['iva_pct']; ?></td>
<td> </td>
</tr>
<?php } while ($row_Pagamenti = mysql_fetch_assoc($Pagamenti)); ?>
</table>'.
'</body></html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream($filename . ".pdf");
?>