my $stmt = sprintf 'SELECT * FROM asd WHERE id = %s', $dbh->quote($id); my $sth = $dbh->prepare($stmt); $sth->execute();