Hi,
Im working on a hi-score board in flash using PHP to add & retrieve the data. My problem is that the loop in the script doesnt work in the *.swf, all it displays is the first record.
This is the code;
<?php
require("func_connect.php");
connect ("localhost","coasters");
if(isset($score)) {
//If score exists enter into DB
$sql = "INSERT INTO coasters (score,name) ".
"VALUES ('$score','$name')";
$result = mysql_query($sql);
echo "Your hi-score has been added!";
}
else {
$result = mysql_query("SELECT * FROM coasters ORDER BY score desc LIMIT 10");
if ($details = mysql_fetch_array($result)) {
$fl_name = $details["name"];
$fl_score = $details["score"];
do {
echo ("&fl_name=$fl_name");
echo ("&fl_score=$fl_score"); }
while ($details = mysql_fetch_array($result));
}
else {
echo "No scores at this time.";
}
}
?>
Do I have to loop in Flash? Any help would be greatly appreciated.
Thanks,
dast