PDA

View Full Version : Save arrays in MySQL


nassau
2006-07-08, 06:52
I've been saving arrays in MySQL for a long time, but, it's been "homemade" arrays with custom separators between key/value pairs and between key and values.

is there another - better - way of doing this? or am i a jackass for having missed real arrays in MySQL?:eek: (i'm pretty sure MySQL don't have that..

staph
2006-07-08, 10:29
If you're using PHP, you could try using php's serialize builtin to get a storable representation of the data to then store in MySQL.

Or you could just loop through the array and store each of the values in a new field.

nassau
2006-07-08, 12:24
oh goodness gracious.... how did i not know about that one - thanks!
:)