or download this
my $stmt = "SELECT * FROM users WHERE $searchfield = ?";
...
my $sth = $dbh->prepare ($stmt) or die "Error Preparing:\n" . $stm
+t . "\nDBI returned: \n", $dbh->errstr;
$sth->execute($searchterm) or die "Unable to execute query: " . $s
+th->errstr;