Hi
Assuming i've understood your question correctly:

The usual way to tackle that is to have a user table, a hobbies table and a userhobbies table.

The user table would have a user id, each id representing one user (no way!) and the hobbies table has a list of hobbies each with a hobby id (no way!) and say a description or something. The user hobbies table just matches users to hobbies and would normally just be a two column table made of user id and a hobby id. Each user could obviously have multiple entries in that table pointing to seperate hobbies then you just do for example

select hobbies.description from userhobbies, hobbies where userhobbies.userid = X and userhobbies.hobbyid = hobbies.id

Then just loop through the recordset to get the result.

If you have heavy loaded server with very large results getting returned like that then you can use things like bitmaps to represent the data and get all your results from one returned row. It's not normally considered a very beautiful way of doing things (but beauty only matters in women imho :)

In reply to RE: Indexing Sublists by Specimen
in thread Indexing Sublists by httptech

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.