my $sth = $dbh->prepare('SELECT * FROM table WHERE name=? AND id=?'); $sth->execute($name, $id);