1
My problem is this when I run this code below echo returns me 3 repeated values I could not figure out why you could give me a strength? : D
<?php
try{
$sql = $pdo->prepare("select * from produtos");
$sql->execute();
$resultado = $sql->fetchObject();
foreach ($resultado as $key) {
echo $resultado->nome;
echo $resultado->quantidade;
}
} catch (PDOException $e){
echo "Erro:\n" . $e->getMessage();
}
?>
Thanks well didactic congratulations :D
– felipe marques
You’re welcome.
– Edilson