tags:

views:

32

answers:

1

Hi all,

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  A: 

Many options here, simplist is as follows:

  1. Connect to db
  2. 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.

Lizard
OK I've serialized my array and entered it into my database. I am using now unserialize but it returns nothing....
chchrist
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**.
back2dos
MYSQL is all I have so I'm stuck with it. This unserialize problem is driving me crazy though...
chchrist
@chchrist: are you sure the array is properly sent to php? what do you get if you var_dump it?
back2dos