Greetings Fellow Monks,
Recently, I have been tasked with the creation of a system that relies on Perl/CGI and MySQL. It involves the creation of 4 entities within the database, all within different tables, with different attributes. Each of these 4 entries is 'commentable'; that is, users can write short, blogcomment-like comments in response to them. All of the entity comments follow the same template(comment author, content, title, etc...), but the entity attributes do not. I would like to write a script that will output the comments for each entity using exactly the same template. I know that this is possible, because the only variance in regards to commenting is the name of the MySQL table that the comment data is stored in. Does anyone know how I would accomplish this?
Thanks,
Spidy
Edit: I'd like something where I can provide a link like this:
- comments.cgi?comments=entityone
- comments.cgi?comments=entitytwo
And the system would be capable of growing, if I later needed to add another entity type.
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.