# Outside of loop my $sth = $dbh->prepare("SELECT * FROM finalLevel3 WHERE id=?"); $sth->execute($ID);