Is there any difference between these two:
$stmt = $db->prepare('SELECT * FROM ARTICLES');
$stmt->execute();
foreach ($stmt as $article) {
echo $article['title'];
}
and
$stmt = $db->prepare('SELECT * FROM ARTICLES');
$stmt->execute();
$articles = $stmt->fetchAll();
foreach ($articles as $article) {
echo $article['title'];
}
Is there any major differences between those two methods?
EDIT: I'm just asking, because both appear to work the same for me.