I'm having trouble on this page right below.
My difficulty is in displaying the products of a particular invoice. Because in statment SELECT * FROM produtos WHERE = ?
does not return anything! But when I put the number physically ( SELECT * FROM produtos WHERE = 4519
) it displays normally!
Here is the code:
<code>
include 'banco.php';
$nota = $_GET['nota'];
$pdoo = Banco::conectar();
$sqll = "SELECT * FROM produtos where numnota = ?";
$qq = $pdoo->prepare($sqll);
$qq->execute(array($nota));
$dataa = $qq->fetch(PDO::FETCH_ASSOC);
print_r($dataa);
foreach ($pdoo->query($sqll)as $row) {
echo '<tr>';
echo '<td>'.$row['descricao'].'</td>';
echo '<td>'.$row['unidade'].'</td>';
echo '<td>'.number_format($row['qtde'],"2",",",".").'</td>';
echo '<td>R$ '.number_format($row['valunit'],"2",",",".").'</td>';
echo '<td>R$ '.number_format($row['desconto'],"2",",",".").'</td>';
echo '<td>R$ '.number_format($row['total'],"2",",",".").'</td>';
echo '</tr>';
}
Banco::desconectar();
</code>