Hi All,
this one seems to puzzle me on how to avoid an unnecessary db error. I need to
run a tally count on a couple tables, and if there isn't any data in the table
it displays the dbError, altho there isn't technical any syntax error in the
query other then no return or results.
my $active = 0;
my $expire = 0;
$sqlquery = qq|SELECT COUNT(m.memid) FROM members m,payhistory p
WHERE p.active = 'Y' AND p.memid = m.memid|;
$active = $dbh->selectrow_array($sqlquery) or dbError();
$sqlquery = qq|SELECT COUNT(*) FROM expired WHERE expdate < CURDATE()|;
$expire = $dbh->selectrow_array($sqlquery) or dbError();
Is this way to avoid the dbError() if the query returns no results(which would
indicate a '0' tally.
thx's
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Tel: 1(225)686-2002
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=