+
+ # this is used by circulation everytime a new borrowers cardnumber is scanned
+ # so we can check an exact match first, if that works return, otherwise do the rest
+ $query = "SELECT * FROM borrowers
+ LEFT JOIN categories ON borrowers.categorycode=categories.categorycode
+ WHERE cardnumber = ?";
+ my $sth = $dbh->prepare($query);
+ $sth->execute($searchstring);
+ my $data = $sth->fetchall_arrayref({});
+ if (@$data){
+ return ( scalar(@$data), $data );
+ }
+ $sth->finish;
+