httptech has asked for the wisdom of the Perl Monks concerning the following question:
So, what is the best way to index all of the choices from the list and insert it into the HOBBIES field in the database? Let's say I'm using a SQL database in this case.Perl Programming Reloading PerlMonks Retipping Shoelaces
What I would likely do is create a second table to contain the list data; for example:
Then in the user table, I use join on the list to have a string to put into the user table like this: Anonymous Monk|89|1:2:3 Then in my perl code I use split to break up the HOBBIES field and then perhaps show its output by name using an array that I loaded from the database ahead of time, $hobbies[1], $hobbies[2], $hobbies[3] But that just seems so obvious and inelegant, it makes me wonder how the professional Monk might handle this situation. So, how do you like to handle this?ID|DATA 1|Perl Programming 2|Reloading PerlMonks 3|Retipping Shoelaces
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Indexing Sublists
by marcos (Scribe) on May 15, 2000 at 17:09 UTC | |
by marcos (Scribe) on May 15, 2000 at 17:11 UTC | |
|
Re: Indexing Sublists
by mikfire (Deacon) on May 15, 2000 at 16:53 UTC | |
by httptech (Chaplain) on May 15, 2000 at 17:44 UTC | |
by kudra (Vicar) on May 15, 2000 at 17:57 UTC | |
by mikfire (Deacon) on May 15, 2000 at 21:57 UTC | |
|
RE: Indexing Sublists
by Specimen (Acolyte) on May 15, 2000 at 19:07 UTC | |
|
Re: Indexing Sublists
by httptech (Chaplain) on May 15, 2000 at 22:55 UTC |