From fbce422b4ee8b7e325ea3a29c5b0da520ee2840a Mon Sep 17 00:00:00 2001 From: tipaul Date: Thu, 4 Dec 2003 09:33:32 +0000 Subject: [PATCH] prepare(?) execute($var) fixes --- C4/Search.pm | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 6ad4ac152f..6dad7400ba 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1248,12 +1248,10 @@ sub ItemInfo { my @results; # print $query; while (my $data=$sth->fetchrow_hashref){ - my $iquery = "Select * from issues - where itemnumber = '$data->{'itemnumber'}' - and returndate is null"; + my $iquery = "Select * from issues where itemnumber = ? and returndate is null"; my $datedue = ''; my $isth=$dbh->prepare($iquery); - $isth->execute; + $isth->execute($data->{'itemnumber'}); if (my $idata=$isth->fetchrow_hashref){ $datedue = format_date($idata->{'date_due'}); } @@ -1267,7 +1265,7 @@ sub ItemInfo { $datedue="Cancelled"; } if ($datedue eq ''){ - $datedue="Available"; +# $datedue="Available"; my ($restype,$reserves)=CheckReserves($data->{'itemnumber'}); if ($restype){ $datedue=$restype; @@ -1480,14 +1478,11 @@ that C is given as C<$itemdata-E{bnotes}>. sub bibitemdata { my ($bibitem) = @_; my $dbh = C4::Context->dbh; - my $query = "Select *,biblioitems.notes as bnotes from biblio, biblioitems,itemtypes -where biblio.biblionumber = biblioitems.biblionumber -and biblioitemnumber = $bibitem -and biblioitems.itemtype = itemtypes.itemtype"; + my $query = "Select *,biblioitems.notes as bnotes from biblio, biblioitems,itemtypes where biblio.biblionumber = biblioitems.biblionumber and biblioitemnumber = ? and biblioitems.itemtype = itemtypes.itemtype"; my $sth = $dbh->prepare($query); my $data; - $sth->execute; + $sth->execute($bibitem); $data = $sth->fetchrow_hashref; -- 2.39.5