Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Storing multiple value field in a MySQL database

by boftx (Deacon)
on Nov 25, 2013 at 20:23 UTC ( #1064287=note: print w/replies, xml ) Need Help??

in reply to Storing multiple value field in a MySQL database

There have been a number of replies now that give a more "ideal" solution. But let's take the OP at face value (as reinforced by a later comment) and accept that he has restrictions that preclude the "better" solutions.

Doing that yields the simpler (but not "ideal" from a DB perspective) of this:

my $memberstr = join('|',@member);

One should probably trim any possible leading and/or trailing whitespace just to be safe. Is this an ideal solution? No. Can it be converted to a better solution later if desired? Yes, and without much hassle.

So rather than point all the problems that the OP has with this (at great length in some cases) just take the OP at his word that he understands all of this and appears to have restrictions that dictate that the less than ideal solution be used.

It helps to remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

Replies are listed 'Best First'.
Re^2: Storing multiple value field in a MySQL database
by itnomad (Scribe) on Nov 27, 2013 at 18:57 UTC

    Well said, boftx. I run into columns that have multiple values separated by commas now and then. It works fine and would be easy to refactor if need be.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1064287]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2018-08-21 03:51 GMT
Find Nodes?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:

    Results (197 votes). Check out past polls.