Fixing a bug ine sql

This commit is contained in:
rangi 2003-06-17 08:48:24 +00:00
parent 923c8fb4d7
commit 63fc432b9e
1 changed files with 11 additions and 11 deletions

View File

@ -366,19 +366,19 @@ sub FillReserve {
# fill in a reserve record....
# FIXME - Remove some of the redundancy here
my $biblio = $res->{'biblionumber'}; my $qbiblio = $dbh->quote($biblio);
my $borr = $res->{'borrowernumber'}; $borr = $dbh->quote($borr);
my $resdate = $res->{'reservedate'}; $resdate = $dbh->quote($resdate);
my $biblio = $res->{'biblionumber'}; my $qbiblio =$biblio;
my $borr = $res->{'borrowernumber'};
my $resdate = $res->{'reservedate'};
# get the priority on this record....
my $priority;
{
my $query = "SELECT priority FROM reserves
WHERE biblionumber = $qbiblio
AND borrowernumber = $borr
AND reservedate = $resdate)";
WHERE biblionumber = ?
AND borrowernumber = ?
AND reservedate = ?";
my $sth=$dbh->prepare($query);
$sth->execute;
$sth->execute($qbiblio,$borr,$resdate);
($priority) = $sth->fetchrow_array;
$sth->finish;
}
@ -387,11 +387,11 @@ sub FillReserve {
{
my $query = "UPDATE reserves SET found = 'F',
priority = 0
WHERE biblionumber = $qbiblio
AND reservedate = $resdate
AND borrowernumber = $borr";
WHERE biblionumber = ?
AND reservedate = ?
AND borrowernumber = ?";
my $sth = $dbh->prepare($query);
$sth->execute;
$sth->execute($qbiblio,$resdate,$borr);
$sth->finish;
}