I have a sales page for a project and I have to pass the data of the cart to an invoice, I have the product and cart tables, and the id's of the products that were bought are stored in the cart.
$query = mysqli_query($con,"select * from productos where idProducto =
'".$carrito['idProducto']."'");
$tax = 0; //total tax
$amount = 0; //total amount
while($productos = mysqli_fetch_array($query)){
$pdf->Cell(130 ,5,$productos['nombre'],1,0);
//add thousand separator using number_format function
$pdf->Cell(25 ,5,number_format($carrito['Cantidad']),1,0);
$pdf->Cell(34 ,5,number_format($productos['precio']),1,1,'R');//end of line
//accumulate tax and amount
$amount += $productos['precio'];
}
I took this out of a tutorial but when I run it, I only see one of the products and I want all of them to come out, I really do not understand sql, help D: