Gossamer Forum
Home : Products : DBMan : Customization :

Number of records in a certain field

Quote Reply
Number of records in a certain field
Been looking at http://www.gossamer-threads.com/...m12/HTML/000954.html , Subj: List of field along with http://www.gossamer-threads.com/...m12/HTML/000853.html .

After posting a couple days ago, realized it had 52 replies -- no wonder no one prob saw my question, :-0. So, here it is again ...

Trying to mirror what donm was asking (in the first aforementioned thread). I created
Code:
sub html_Year_Grad {# --------------------------------------------------------# Browse Top 5 Graduating Classes
open (DB, "<$db_file_name") or &cgierr("unable to open $db_file_name. Reason: $!"); @lines = <DB>;close DB;$fieldnum = 2; foreach $line (@lines) { @data = &split_decode($line); ++$count{$data[$fieldnum]};} $i = 1;foreach $gyear (sort {$count{$b} <=> $count{$a} } keys %count) { if ($i>5) { last; } print "$gyear: ($count{$gyear})<BR>"; ++$i;}
... which I "think" is correct. But my "link" to the above info is all out of whack. I've got
Code:
print qq!| <a href="$db_script_link_url&Year_Grad=1&sb=2&so=descend">Top 5 Classes</a> ! if ($per_view);
in sub html_footer and
Code:
elsif ($in{'Year_Grad'}) { if ($per_view) { &html_Year_Grad; } else { &html_unauth; } }
in db.cgi.

Any code hackers tell me what I'm missing? Please, <g>

JR

------------------
Joebagodonuts, JR or Anita
http://home.flash.net/~murgnam/
Quote Reply
Re: Number of records in a certain field In reply to
Joe,

I sent you an email. Hope it helps !

---------------
donm
Quote Reply
Re: Number of records in a certain field In reply to
Well, I did all the difficult default, db and html.pl parts right ... too bad I forgot the obvious creation of the .html (&html_print_headers; &html_footer Wink part, d'oh.

Thx Don ... works like a charm now, :-)

JR