Groups | Blog | Home
all groups > flash data integration > september 2005 >

flash data integration : Exporting arrays to MySQL


Alex
9/8/2005 12:00:00 AM
I need to export some data from Flash to MySQL. Some elements which have own
properties, defined into the Flash application.
I need to create a record (into MySQL table) for each element I export, with
all the fields compiled.
I was thinking about a way to export associative arrays, a way that PHP
could read easily to make some "for" cycles and create/update the records.
Any ideas?

Thanks much.

dParser
9/8/2005 7:00:08 PM
If you are exporting associative arrays to PHP in some way, you might try
serializing them in PHP and then placing them in MySQL as a string. When it
comes time to get the data out of MySQL, unserialize the string, process it
in some way and send it back to Flash (perhaps as XML).

The "some way" you use in PHP will be entirely up to your skill level.

Richard

[quoted text, click to view]

Alex
9/9/2005 12:00:00 AM

"dParser" <rhoeper@earthlink.net> ha scritto nel messaggio
news:dfqmij$pqh$1@forums.macromedia.com...
[quoted text, click to view]

Thanks Richard. I think that the hardest thing is right to export the
associative arrays to PHP. How could I do that?

dParser
9/10/2005 11:36:19 AM
Possible Ideas:
1. compare the structure of an associative array in Flash to one in PHP.
Sent the Flash array over to PHP as a string (if this can be done), and
process the string into the correct PHP structure. Serialize the processed
array and place it into MySQL. This, of course, is a "some way" I was
talking about.

2. look into using AMFPHP and see if you can send your data as a two-way
binary format that can be used with MySQL

3. convert back and forth using XML.

4. in PHP you may have to write scripts using regular expressions to convert
associative arrays from Flash to PHP and vice versa, as the syntax is
different for the arrays.

5. you may be looking at some serious scratching-the-head time


[quoted text, click to view]

Alex
9/10/2005 10:29:28 PM

"dParser" <rhoeper@earthlink.net> ha scritto nel messaggio
news:dfv5ac$c5r$1@forums.macromedia.com...
[quoted text, click to view]

[cut]

Really, thank you. I found an ActionScript/PHP class made by an Italian
designer (sephiroth.it) that shoud serialize my arrays. I'm going to try it,
then, if I'm not successful, I'll try to learn AMFPHP, but I'm worried I
should have root permission on the server in order to use it. I'll keep
studying...

AddThis Social Bookmark Button