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

flash data integration : Flash & PhP


v_teo
5/20/2005 12:00:00 AM
Hi. I am bothering you again because I really need to know how to make flash
and php talk WITHOUT using amfphp... I would apreciate any help as I tried to
follow other's help and did not do anything... The PHP file :

------------------------------------act.php-------------------------------------
--
<?php
$host = "localhost";
$user = "root";
$pass = "23121987";
$conn = mysql_connect($host,$user,$pass);

$tot = mysql_query("Select * from kappa1987_membri.tabel",$conn);

while ($k=mysql_fetch_row($tot))
{
for ($i=0;$i<count($k);$i++)
{
print "&k[$i]=";
print $k[$i];
}
print "\n";
}
?>
----------------------------------------------
works perfectly(written by hand )
But, because the result an array of records, I'm not sure how to do...So
please explain to me how to do it...I would be very thankful...

Regards,
N0L|m|tz
P.S. Sorry for the bothering but I really need to know how to do this...
Joaquim Lopes
5/21/2005 12:00:00 AM
You coulod change your PHP code to this:

<?php
$host = "localhost";
$user = "root";
$pass = "23121987";
$conn = mysql_connect($host,$user,$pass);

$tot = mysql_query("Select * from kappa1987_membri.tabel",$conn);
$result = "&myArray=";

while ($k=mysql_fetch_row($tot))
{
for ($i=0;$i<count($k);$i++)
{
$result .= $k . "|"; // Use a character that you know will not be present in
the text
}
print $result;
}
?>

Then on the Flash side use

results = myArray.split("|");
numElements = results.length;


Hope this helps.
adireddy
5/23/2005 12:00:00 AM
AddThis Social Bookmark Button