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
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