0
ERROR: it simply does not query when playing on a foreach because LIMIT does not become the variable I declared Does anyone know me?
$cont = 2;
$stm = $pdo->prepare('SELECT sol_camiseta.id,
sol_camiseta.tipo,
sol_camiseta.cor,
sol_camiseta.tamanho,
sol_camiseta.qtd,
sol_camiseta.valor,
sol_camiseta.data_pedido,
pagamento_camiseta.cod_sol_camiseta,
pagamento_camiseta.data_pagamento,
pagamento_camiseta.data_retirada
FROM sol_camiseta
INNER JOIN pagamento_camiseta
WHERE sol_camiseta.cod_nome_aluno = :id LIMIT :cont' );
$stm->bindValue( ':id', $_GET['id'] );
$stm->bindValue( ':cont', $cont);
//Executa o pdo
$stm->execute();
$consultas = $stm->fetchAll( PDO::FETCH_ASSOC );
<?php foreach ( $consultas as $consulta ): ?>
<tr>
<td>Tipo:</td>
<td><?php echo $consulta['tipo']; ?></td>
<td>Cor:</td>
<td><?php echo $consulta['cor']; ?></td>
<td>Tamanho</td>
<td><?php echo $consulta['tamanho']; ?></td>
<td>Quantidade</td>
<td><?php echo $consulta['qtd']; ?></td>
<td>Valor</td>
<td><?php echo $consulta['valor']; ?></td>
<?php endforeach; ?>
Thank you very much guy worked out, I can’t believe it... really
– Victor Mansolelli
You’re welcome -.
– Edilson