Now using real data. Returns first 20 records where author starts with 's'
[koha.git] / html-template / search.pl
1 #!/usr/bin/perl -w
2 use HTML::Template;
3 use strict;
4 require Exporter;
5 use C4::Database;
6
7
8 my $dbh=&C4Connect;  
9
10
11 my $template = HTML::Template->new(filename => 'searchresults.tmpl', die_on_bad_params => 0);
12
13 my @results;
14 my $sth=$dbh->prepare("select * from biblio where author like 's%' limit 20");
15 $sth->execute;
16 while (my $data=$sth->fetchrow_hashref){    
17     push @results, $data;
18 }
19
20
21
22
23 $template->param(SEARCH_RESULTS => \@results
24                 );
25
26
27 print "Content-Type: text/html\n\n", $template->output;