Ho letto delle guide offerte da questo sito. Volevo cimentarmi con FPDF.
Ora ho questo piccolo esempio funzionante.
Codice PHP:
<?php
define('FPDF_FONTPATH','font/');
require('fpdf.php');
$pdf=new FPDF('P','mm','A4');
$pdf->Open();
$pdf->AddPage();
$pdf->SetFont('Arial','B',12);
$pdf->Cell(40,10,'Hello World!');
$pdf->Cell(60,10,'Powered by FPDF.',0,1,'C');
$pdf->Output();
?>
Come posso interagire con un database?
Vorrei far stampare questo
Codice PHP:
$res = paging("SELECT * FROM listino ORDER BY id_lis DESC", 5, 5);
while ($row = mysql_fetch_array($res[0])) {
$nome = mysql_query("SELECT nome_barca FROM imbarcazioni_descrizione WHERE id_desc = ".$row['id_imbarcazioni']) ;
while ($row2 = mysql_fetch_array($nome)) {
$nome_b = $row2['nome_barca'];
} //chiudo while nome
echo " <tr>
<td class='tr pad' align='left'>".$nome_b."</td>
<td class='tr' align='center'>".$row['periodo_A']." €</td>
<td class='tr' align='center'>".$row['periodo_B']." €</td>
<td class='tr' align='center'>".$row['periodo_C']." €</td>
<td class='tr' align='center'>".$row['periodo_D']." €</td>
<td class='tr' align='center'>".$row['skipper']." €</td>
<td class='tr' align='center'>".$row['pulizie']." €</td>
<td align='center'>".$row['cauzione']." €</td>
</tr>";
echo "<tr><td colspan='8' id='tr2'><img src=\"".DIR_AV_IMAGES."blank.jpg\" width='1' height='1'></td></tr>
<tr><td colspan='8'><img src=\"".DIR_AV_IMAGES."blank.jpg\" width='1' height='2'></td></tr>";
} /* chiudo while listino */
?>
Poitreste indicarmi come legare i codici?
Grazie