Improving Research on Bookseller
authorHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Tue, 6 Oct 2009 09:56:00 +0000 (11:56 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Tue, 6 Oct 2009 11:21:10 +0000 (13:21 +0200)
Can search now on any word

C4/Bookseller.pm

index 0244bc3..0153f2b 100644 (file)
@@ -69,9 +69,9 @@ aqbooksellers table in the Koha database.
 sub GetBookSeller($) {
     my ($searchstring) = @_;
     my $dbh = C4::Context->dbh;
-    my $query = "SELECT * FROM aqbooksellers WHERE name LIKE ?";
+    my $query = "SELECT * FROM aqbooksellers WHERE name LIKE ? ";
     my $sth =$dbh->prepare($query);
-    $sth->execute( "$searchstring%" );
+    $sth->execute( "%$searchstring%");
     my @results;
     # count how many baskets this bookseller has.
     # if it has none, the bookseller can be deleted