come promesso questo è il listato
Codice PHP:
if( $conn ) {
{
$query = "SELECT
nwPrevProdotti.IdLavoro,
nwPrevProdotti.prodotto,
nwPrevProdotti.tiratura1,
nwPrevProdotti.tiratura2,
nwPrevProdotti.tiratura3,
nwPrevProdotti.tiratura4,
nwPrevProdotti.prezzoUnitario1,
nwPrevProdotti.prezzoUnitario2,
nwPrevProdotti.prezzoUnitario3,
nwPrevProdotti.prezzoUnitario4,
nwPrevClienti.cliente,
nwPrev.description,
nwPrev.responsabile,
nwPrevAgenti.agente
FROM nwPrevProdotti
LEFT JOIN nwPrevClienti ON nwPrevProdotti.IdLavoro = nwPrevClienti.IdLavoro
LEFT JOIN nwPrev ON nwPrevProdotti.IdLavoro = nwPrev.IdLavoro
LEFT JOIN nwPrevAgenti ON nwPrevProdotti.IdLavoro = nwPrevAgenti.IdLavoro
WHERE nwPrevProdotti.IdLavoro LIKE '%%'
";
}
//
// Perform Query
$result = sqlsrv_query($conn, $query);
if (!$result) {
$texthtml .= 'Errore di query: ' . sqlsrv_errors() . "
";
$texthtml .= 'Testo della query: ' . $query;
}
while ($row = sqlsrv_fetch_array($result)) {
$texthtml .= "<tr>";
$texthtml .= "<td>";
$texthtml .= $row['IdLavoro'];
$texthtml .= "
".$row['cliente'];
$texthtml .= "
".$row['agente'];
$texthtml .= "
".$row['responsabile'];
$texthtml .= "</td>";
$texthtml .= "<td>";
$texthtml .= $row['prodotto'];
$texthtml .= "
".$row['description'];
$texthtml .= "</td>";
$texthtml .= "<td>";
$texthtml .= $row['tiratura1'];
$texthtml .= "/";
$texthtml .= $row['tiratura2'];
$texthtml .= "/";
$texthtml .= $row['tiratura3'];
$texthtml .= "/";
$texthtml .= $row['tiratura4'];
$texthtml .= "
";
$texthtml .= round($row['prezzoUnitario1'],4);
$texthtml .= "/";
$texthtml .= round($row['prezzoUnitario2'],4);
$texthtml .= "/";
$texthtml .= round($row['prezzoUnitario3'],4);
$texthtml .= "/";
$texthtml .= round($row['prezzoUnitario4'],4);
$texthtml .= "</td>";
$texthtml .= "</tr>";
}
// Free the resources associated with the result set
// This is done automatically at the end of the script
}
else
{
$texthtml .= "Errore di connessione verificare file di programmazione.\n";
die( print_r( sqlsrv_errors(), true));
}
???