From 732e834edf42c98c66fb7ab0151c2f2c077e516a Mon Sep 17 00:00:00 2001 From: slef Date: Mon, 8 Dec 2003 14:14:56 +0000 Subject: [PATCH] DBI call fix for bug 662 --- C4/Circulation/Borrissues.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/C4/Circulation/Borrissues.pm b/C4/Circulation/Borrissues.pm index f9eb0af737..60513629b0 100755 --- a/C4/Circulation/Borrissues.pm +++ b/C4/Circulation/Borrissues.pm @@ -43,15 +43,14 @@ sub printallissues { my ($env,$borrower)=@_; my @issues; my $dbh = C4::Context->dbh; - my $query = "select * from issues,items,biblioitems,biblio - where borrowernumber = '$borrower->{'borrowernumber'}' + my $sth = $dbh->prepare("select * from issues,items,biblioitems,biblio + where borrowernumber = ? and (returndate is null) and (issues.itemnumber = items.itemnumber) and (items.biblioitemnumber = biblioitems.biblioitemnumber) and (items.biblionumber = biblio.biblionumber) - order by date_due"; - my $sth = $dbh->prepare($query); - $sth->execute(); + order by date_due"); + $sth->execute($borrower->{'borrowernumber'}); my $x; while (my $data = $sth->fetchrow_hashref) { # FIXME - This should be $issues[$x] = $data, right? -- 2.39.5