my $input = new CGI;
my $query = $input->param('query');
+binmode STDOUT, ":utf8";
print $input->header(-type => 'text/plain', -charset => 'UTF-8');
my ($auth_status, $sessionID) = check_cookie_auth($input->cookie('CGISESSID'), { circulate => '*' });
FROM borrowers
WHERE surname LIKE ?
OR firstname LIKE ?
+ OR cardnumber LIKE ?
ORDER BY surname, firstname);
- #"OR cardnumber LIKE '" . $query . "%' " .
my $sth = $dbh->prepare( $sql );
-$sth->execute("$query%", "$query%");
+$sth->execute("$query%", "$query%", "$query%");
+
while ( my $rec = $sth->fetchrow_hashref ) {
print $rec->{surname} . ", " . $rec->{firstname} . "\t" .
$rec->{cardnumber} . "\t" .