Routine never executed query due to syntax error
and returned undef
made the call to fetchrow_array explicit as the old fetchrow alias
is no longer documented in perldoc DBI
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
sub HasItems {
my ($subscriptionid) = @_;
my $dbh = C4::Context->dbh;
- my $query = qq|
+ my $query = q|
SELECT COUNT(serialitems.itemnumber)
FROM serial
LEFT JOIN serialitems USING(serialid)
- WHERE subscriptionid=? AND serialitems.serialid NOT NULL
+ WHERE subscriptionid=? AND serialitems.serialid IS NOT NULL
|;
my $sth=$dbh->prepare($query);
$sth->execute($subscriptionid);
- my ($countitems)=$sth->fetchrow;
+ my ($countitems)=$sth->fetchrow_array();
return $countitems;
}