Because the following code works:
$stmt = $pdo->prepare("SELECT * FROM dados");
$stmt->execute();
$codigos = $stmt->fetch();
echo $codigos['codigo'];
So I can not use it?
$stmt = $pdo->prepare("SELECT * FROM dados");
$stmt->execute();
$codigos = $stmt->fetchAll();
echo $codigos['codigo'];