or download this
$db_query = "SELECT ST.sno_name,HT.homolog_name FROM sno_Table ST,
+Homolog_Table HT,sno_Homologs SH,Organism O
WHERE ST.sno_id=SH.sno_id AND SH.homolog_id=HT.homolog_id AND HT.org_i
+d=O.org_id and (ST.family=$family) and
...
$sth->execute();
my $total = $sth->rows;
print "total rows: $total<br>"; # add this