Gossamer Forum
Home : Products : DBMan : Installation :

Counting no. of entries for each category

(Page 2 of 2)
> >
Quote Reply
Re: Counting no. of entries for each category In reply to
I am completely stumped. I usually don't give up on things, but I just don't know what to tell you.

I'm sorry.


------------------
JPD

All my advice is offered on the basis of kindness-ware. If I've helped you to solve a problem, go out of your way to be kind to someone today.

Quote Reply
Re: Counting no. of entries for each category In reply to
There's a thread in the other DBMan forum that might have the answer for you. Or at least it gave me an idea.

One more time:

Code:
$in{$db_key} = "*";
in{'mh'} = 1000; #make this a number that you know is larger than the number of records you have
my ($status,@hits)=&query();
for (0 .. $db_total_hits - 1) {
%cattmp = &array_to_hash($_,@hits);
if ($cattmp{'Category'}) { ++$catcount{$cattmp{'Category'}};
# ++$count; this line isn't necessary
}
}
foreach my $Category (keys %catcount) {
print "$Category: $catcount{$Category}<br>\n";
# print "$count"; this line isn't necessary
}

I just hate to give up on things!

In the other thread, Alex talked of making changes to the db.cgi script. You can look at that, if you want. It's at
http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/000088.html

So this gives you two ways to go.

---------------
JPD


[This message has been edited by JPDeni (edited March 04, 1999).]
Quote Reply
Re: Counting no. of entries for each category In reply to
Anyway thanks JPD, you need not to feel
sorry at all Smile

I can live without this mod, just dunno
whether anyone else have used it and do
they get the right results?
> >