Alex Rivera | Logout

Save PHP array to MySQL?

Asked 2009-12-30T04:33:30.930
95

What is a good way to save an array of data to a single mysql field?

Also once I query for that array in the mysql table, what is a good way to get it back into array form?

Is serialize and unserialize the answer?

Edit
Report

1 Answer

6

Serialize and unserialize are pretty common for that. You could also use JSON via json_encode and json_decode for a less PHP-specific format.

answered 2009-12-30T04:35:45.543

Your Answer