Help for this page

Select Code to Download


  1. or download this
    ...
        my $searchterm = $query->param('searchterm');
    ...
    my $sth = $dbh->prepare ($stmt) or die "Error Preparing:\n" . $stmt . 
    +"\nDBI returned: \n", $dbh->errstr;
        
        $sth->execute () or die "Unable to execute query: " . $sth->errstr
    +;
    
  2. 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;