# Bar Graphs and PHP/MySQL

**URL:** <https://forum.kirupa.com/t/bar-graphs-and-php-mysql/261579>\
**Category:** flash\
**Created:** [May 29, 2008, 12:08am UTC](https://forum.kirupa.com/t/bar-graphs-and-php-mysql/261579 "2008-05-29T00:08:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![one\_way\_7](https://avatars.discourse-cdn.com/v4/letter/o/dec6dc/32.png) [@one\_way\_7](https://forum.kirupa.com/u/one_way_7)\
**Post date:** [May 29, 2008, 12:08am UTC](https://forum.kirupa.com/t/bar-graphs-and-php-mysql/261579/1 "2008-05-29T00:08:40Z")

</div>

Hello All!  
I’m trying to make a Bar graph that feeds off of data from a MySQL dbase, and server side language is php. I think I have the ‘bar’ part working, and i’m just messing with getting the data.  
PHP data:

```php
$string .="&bench".$i."=".$row['Bench']."&result".$i."=".$row['Baseline'];

```

Actionscript:

```auto
onClipEvent (load) {

    myData = new LoadVars() 
    myData.load("http://localhost/sites.php") 
	_root.tim.htmlText = "";
    myData.onLoad = function(success){ 
      if(success){ 

	  for(var i = 0; i < 15; i += 1)
	  {
	   	  _root.datafornewBAR += myData["result"+i];
			duplicateMovieClip (_root.bar1, "bar" + i, i);
	  }
		  
      } else trace ("Error loading data") 
    }

}

```

It appears the data is looping through the array, but it does this faster than duplicateMovieClip so, all of the bars on the graph have the same value (the last value).

Any thoughts?  
Thanks!

-Tim

---

<div class="post-metadata">

**Author:** ![sparkdemon](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sparkdemon](https://forum.kirupa.com/u/sparkdemon)\
**Post date:** [May 29, 2008, 7:38pm UTC](https://forum.kirupa.com/t/bar-graphs-and-php-mysql/261579/2 "2008-05-29T19:38:35Z")

</div>

didnt get your question… how is data loading related to duplicatemovieclip command
