I have this code:
$sql = "SELECT id FROM videos";
$stmp = $db->prepare($sql);
$stmp->execute();
while ($row = $stmp->fetchAll(PDO::FETCH_ASSOC)) {
$vkey = md5($row['id'] . "video");
$sql = "UPDATE videos SET vkey = :vkey WHERE id = :id";
$stmp = $db->prepare($sql);
$stmp->execute(array(
":vkey" => $vkey,
":id" => $row['id']
));
}
Why is execute only for the first id from the first select and not for all it's in the loop?