Question : How to create a flash object that displays data from a PHP file (data from mysql db)?

SWISHMAX2 PHP MYSQL

Hello,

(01) This is what I want to do:
I want to extract data from a MySQL database and show it as a table in Flash


(02) What I know:
- I need to have a MySQL database; I have that.
- I need to code a PHP file to extract data from the MySQL database; I have that.
- I need to use SwishMax to create a .swf file that will display the contents in the PHP file


(03) What I don't know:
- I don't know how to use SwishMax to create a .swf file that will display the contents in the PHP file.


(04) What I have done with SwishMax2 (my futile attempt):

Step 1
Create a new swish movie file called display.swi.

Step 2
> "Add Script" pull-down menu
> Select "External files and data"
> Select "Load/unload Movie Clip
> Select "loadVariables(...)"

Step 3
Change the code to

onFrame (1) {
loadVariables("display.php",'GET');
}

Step 4
Save the display.swi file and export to display.swf file (SWF 6 format is OK?)

Step 5
Upload
(a) display.php
(B) display.swf

Step 6
Browse display.swf via browser. Nothing.

What have I done wrong?


(05) My MySQL table format:
[name] [address] [contact_person]


(06) My PHP file:
[CODE]


$link = mysql_connect("localhost","username","password");
mysql_select_db("dbORG");

$results = mysql_query("SELECT * FROM tblORG ORDER BY name LIMIT 5");

while ($row = mysql_fetch_array($results))
        {
            extract($row);

            echo "\n";

            echo " \n";

            echo "
$name$address$contact_person</td>
\n";

        }

?>

[/CODE]

Answer : How to create a flash object that displays data from a PHP file (data from mysql db)?

as i haven't used swishmax2 can you add any components such as the datagrid control?  for this example to work all you need to have is a swf with the datagrid in the library and exported in the first frame:

http://www.flashgamer.com/2006/02/skinning_the_flash_datagrid.html
Random Solutions  
 
programming4us programming4us