# How to get data from MySQL into Flash CS3 using AS2?

**URL:** <https://forum.kirupa.com/t/how-to-get-data-from-mysql-into-flash-cs3-using-as2/279647>\
**Category:** flash\
**Created:** [January 16, 2009, 10:39pm UTC](https://forum.kirupa.com/t/how-to-get-data-from-mysql-into-flash-cs3-using-as2/279647 "2009-01-16T22:39:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phusa](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@phusa](https://forum.kirupa.com/u/phusa)\
**Post date:** [January 16, 2009, 10:39pm UTC](https://forum.kirupa.com/t/how-to-get-data-from-mysql-into-flash-cs3-using-as2/279647/1 "2009-01-16T22:39:30Z")

</div>

Hello Everybody!  
I 'm Phusa. I 've read a tutorial about Flash, PHP and MySQL Integration.  
I imitated that tutorial, but I will unsuccess.  
All files I written as follows:

- DataBase Name: dbtestflash
- Table Name: sites
- PHP file Code:

```php
 
<?php
mysql_pconnect ("localhost","root","");
mysql_select_db ("dbtestflash");
$qResult = mysql_query ("SELECT * FROM sites ORDER BY id ASC");
$nRows = mysql_num_rows($qResult);
$rString ="&n=".$nRows;
for ($i=0; $i< $nRows; $i++){
 $row = mysql_fetch_array($qResult);
 $rString .="&amp;id".$i."=".$row['id']."&"."&title".$i."=".$row['title']."&"."&link".$i."=http://".$row['link']."&";
}
echo $rString."&";
?>

```

- AS file Code:  
[AS]  
function lv(l, n, t, e, f) {  
if (l == undefined) {  
l = new LoadVars();  
l.onLoad = function() {  
var i;  
n.htmlText = “”;  
if (t == undefined) {  
n.htmlText += “\<b\>”+this[“title”+e]+"\</b\>\<br\>";  
} else {  
for (i=0; i\<this.n; i++) {  
n.htmlText += “\<class=‘menu\_item’\>\<a href=’”+this[“link”+i]+"’\>"+this[“title”+i]+"\</a\>\<br\>";  
}  
}  
};  
}  
l.load(f);  
}  
lv(sites\_txt, “cycle”, null, “sites.php”);[/AS]

Please help me!
