Using one column for each month makes it rather hard to get the database to some of this work for you. If instead of the "f1".."f12", etc., columns you had a "month" column and single columns for "f", "m", "rf", and "rm", you could do the month selection and trimester rollups via a query. A bit of reading on relational database "normal forms" and their benefits might pay off for you.
I'm suspicious of the DISTINCT in that second SELECT. Are you really sure you're gettin back the data you want?
Without knowing more about the data, it's hard to know whether you have a problem tripping the month tests multiple times. I suggest adding
if ($month eq "1") #January, obviously
{
>>> $message .= "<!-- January -->\n";
and so on for the other months.
This will tell you whether you're accidentally tripping those tests multiple times, and clobbering counters.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.