Gossamer Forum
Home : Products : DBMan : Customization :

Catagory Count

Quote Reply
Catagory Count
Hi, in thread
http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/000638.html
There was some code given that was used to setup a cout of countries like this:

Belgium (2)
France (3)
Luxembourg (0) or locations with 0 records can be omitted.

But when I tried to use the code to setup a catagory count. I get an error at ++total_count;
code:
open (DB, "<$db_default.db") or &cgierr("error in count. unable to open database: $db_default.db.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); } @lines = <DB>;
close DB; foreach $line (@lines) { chomp ($line);
@data = &split_decode($line);
++$count{$data[3]};

}

print qq|Parts list:<P><table>|;
foreach $catagory (%count) {
print qq|<tr><td>$catagory:</td><td>$count{$catagory}</td></tr>|;
}
print qq|<tr><td>Total:</td><td>$total_count</td></tr></table>|;
}

Did I modify this right?

Thanks!

------------------
Sherwin Sales@jse.net
Subject Author Views Date
Thread Catagory Count Sherwin 2970 Sep 30, 1999, 8:17 AM
Post Re: Catagory Count
Sherwin 2877 Sep 29, 1999, 9:03 PM
Post Re: Catagory Count
JPDeni 2877 Sep 29, 1999, 9:09 PM
Post Re: Catagory Count
Sherwin 2865 Sep 29, 1999, 9:54 PM
Post Re: Catagory Count
JPDeni 2881 Sep 30, 1999, 10:10 AM
Post Re: Catagory Count
Sherwin 2860 Oct 3, 1999, 5:11 PM
Post Re: Catagory Count
JPDeni 2866 Oct 3, 1999, 6:58 PM
Post Re: Catagory Count
Sherwin 2864 Oct 3, 1999, 7:10 PM
Post Re: Catagory Count
Sherwin 2874 Oct 3, 1999, 7:13 PM