Quote
What's the best way to store an array in MYSQL?
To rephrase the question:
"What's the best way to
retrieve an array
from MYSQL?"
And, as ever, the answer is "It depends".
Working backwards ...
What are you going to
do with it once you've 'select'ed it?
If all you're going to do is send it back to the user intact, then keeping it together as a single unit is probably best. Why take it all apart if you're only going to put it all together again?
How are you going to "find" the data?
If you're going to run queries against the individual "bits" of that array, then the picture is completely different.
In that case, you
have to pull the array apart and store it into
rows, because that's far,
far easier for your database to interrogate. Rummaging around "inside" string values is
never going to perform well (because you can't use any indexes).
Regards, Phill W.