You asked what I would do, so take this with a grain of salt, of course. I'm assuming that there may be some reuse of keywords, so what I would do is normalize the data (note that I am far from an expert in database design, but I found this article to be a pretty good introduction to the ideas of normalization) like so:
--------------------------------------------- | meta_table_page_info | --------------------------------------------- | page_id | page | keyword_separator | desc | --------------------------------------------- -------------------------- | keywords | -------------------------- | keyword_id | keyword | -------------------------- --------------------------- | page_to_keyword_mapping | --------------------------- | page_id | keyword_id | ---------------------------
With this scheme, you'll put all the keywords you'll use for all the pages in the keywords table, the separator you want for each page in the keyword_separator column of the main table, and the mapping of keywords to pages in the third table. An example... say you have:
-------------------------------------------------------------- | meta_table_page_info | -------------------------------------------------------------- | page_id | page | keyword_separator | desc | -------------------------------------------------------------- | 1 | some_page | , | some_description | -------------------------------------------------------------- -------------------------- | keywords | -------------------------- | keyword_id | keyword | -------------------------- | 1 | keyword_1 | | 2 | keyword_2 | | 3 | keyword_3 | --------------------------
and you want page 1 to have keywords "keyword_1,keyword_3". Then the mapping table would look like:
--------------------------- | page_to_keyword_mapping | --------------------------- | page_id | keyword_id | --------------------------- | 1 | 1 | | 1 | 3 | ---------------------------
To build the actual string, you'd use a SQL statement in the vein of
SELECT m.keyword_separator, k.keyword FROM keywords k, page_to_keyword_mapping p, meta_table_page_info m WHERE p.page_id = ? AND m.page_id = p.page_id AND k.keyword_id = p.k +eyword_id
Then you execute(page_number), and go from here. This may be far more complicated than you were wanting, but designing it like this leaves lots of room for expansion.

In reply to Re: Seeking YOUR Wisdom... CGI.pm, Database and YOU by jgallagher
in thread Seeking YOUR Wisdom... CGI.pm, Database and YOU by powerhouse

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.