How can I save to my mysql db an array from flash? I pass the array as a parameter to a php script. What I have to do next?
1 Answer
Many options here, simplist is as follows:
- Connect to db
- searialize array and store in db
http://php.net/manual/en/function.serialize.php - This will convert the array in a string, which can be unserialized later.
4 Comments
chchrist
OK I've serialized my array and entered it into my database. I am using now unserialize but it returns nothing....
back2dos
not sure, this is such a good idea to use and SQL data store like this. On the other hand, SQL is both static and outdated. I'd suggest using MongoDB, where this can be achieved in a much simpler and more intuitive way and, more importantly: without a hack.
chchrist
MYSQL is all I have so I'm stuck with it. This unserialize problem is driving me crazy though...
back2dos
@chchrist: are you sure the array is properly sent to php? what do you get if you var_dump it?