From 867a82398e562404e371fa364675a02ce27b6b56 Mon Sep 17 00:00:00 2001 From: tipaul Date: Mon, 3 Mar 2003 17:36:32 +0000 Subject: [PATCH] migrating to prepare (?) execute($var) structure --- C4/Search.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 0bd312cc88..018faf76e0 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -2128,14 +2128,14 @@ sub itemcount2 { my ($env,$bibnum,$type)=@_; my $dbh = C4::Context->dbh; my $query="Select * from items,branches where - biblionumber=$bibnum and items.holdingbranch=branches.branchcode"; + biblionumber=? and items.holdingbranch=branches.branchcode"; if ($type ne 'intra'){ $query.=" and ((itemlost <>1 and itemlost <> 2) or itemlost is NULL) and (wthdrawn <> 1 or wthdrawn is NULL)"; } my $sth=$dbh->prepare($query); # print $query; - $sth->execute; + $sth->execute($bibnum); my %counts; $counts{'total'}=0; while (my $data=$sth->fetchrow_hashref){ @@ -2174,10 +2174,10 @@ sub itemcount2 { $status = $data->{'branchname'} unless defined $status; $counts{$status}++; } - my $query2="Select * from aqorders where biblionumber=$bibnum and + my $query2="Select * from aqorders where biblionumber=? and datecancellationprinted is NULL and quantity > quantityreceived"; my $sth2=$dbh->prepare($query2); - $sth2->execute; + $sth2->execute($bibnum); if (my $data=$sth2->fetchrow_hashref){ $counts{'order'}=$data->{'quantity'} - $data->{'quantityreceived'}; } -- 2.39.5