# \[F8\] mysql + flash help

**URL:** <https://forum.kirupa.com/t/f8-mysql-flash-help/254380>\
**Category:** flash\
**Created:** [March 11, 2008, 2:33pm UTC](https://forum.kirupa.com/t/f8-mysql-flash-help/254380 "2008-03-11T14:33:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jay0316](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@jay0316](https://forum.kirupa.com/u/jay0316)\
**Post date:** [March 11, 2008, 2:33pm UTC](https://forum.kirupa.com/t/f8-mysql-flash-help/254380/1 "2008-03-11T14:33:40Z")

</div>

I’m wanting the top 10 scores to display for a game I’m working on. I’m having trouble getting the information to display in a dynamic text box. I’ve been working on this for 2 days looking at examples and haven’t had any luck. I don’t know how to get more than one result to show in a dynamic text fields variable. I assume you can do it.

Right now I am getting it to display the very last name in my database. It seems like I’m close, but there needs to be some minor adjustments or something. Could someone give me a suggestion on how to fix this?

Here is my **php** :

```auto

<?php
//connect to database
  $link = mysql_connect(localhost, username, password)
            or die("<b>error</b>: failed to connect to database");

//select the name column
  $query = "SELECT name FROM coas.safety_scores";
  $result = mysql_query($query) 
              or die("<b>error</b>: failed to execute query <i>$query</i>");

//print names to flash dynamic textbox variable, timer
  while ($desiredContent = mysql_fetch_array($result))
  {
      $name=$desiredContent['name'];
      print "&timer=".$name;
  }

?>

```

Here is the **actionscript** :

```auto

onClipEvent (load) {
var preVars = new LoadVars();
preVars.action = 'preview';
preVars.sendAndLoad("http://coastal/process_scores.php", preVars, 'GET');
preVars.onLoad = function() {
        _root.movie.score.text = this.timer;
    };
}

```
