$statement = $pdo->prepare("
SELECT
spalte1,
spalte2,
spalte3,
spalte4
from
tabelle
where
spalte = 1234");
if($statement->execute())
{
$count = $statement->rowCount();
}
else
{
echo "SQL Error <hr />";
echo $statement->queryString."<br />";
$Error = $statement->errorInfo();
echo $Error[2];
}
while ($ergebnis = $statement->fetch() )
{
echo $ergebnis['spalte1'];
}