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 - 21 May 2005 20:58 GMT
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 - 23 May 2005 09:36 GMT
Refer http://www.devarticles.com/c/a/Flash/The-Power-of-LoadVars-Object/ to know how to communicate between PHP and Flash.