# From MySql to Flash with PHP | HELP! =(

**URL:** <https://forum.kirupa.com/t/from-mysql-to-flash-with-php-help/158125>\
**Category:** Uncategorized\
**Created:** [August 7, 2005, 11:09am UTC](https://forum.kirupa.com/t/from-mysql-to-flash-with-php-help/158125 "2005-08-07T11:09:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Azazel](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@Azazel](https://forum.kirupa.com/u/Azazel)\
**Post date:** [August 7, 2005, 11:09am UTC](https://forum.kirupa.com/t/from-mysql-to-flash-with-php-help/158125/1 "2005-08-07T11:09:06Z")

</div>

The tut of what i’m trying to do can be found [here](http://www.kirupa.com/developer/actionscript/flashphpxml_integration.htm).

I tried everything (that I can think of) :h: … anybody else have any ideas on what the problem could be!? :sigh:

Oh, yea 🐇 … hehe, THE PROBLEM IS: it doesn’t dissplay anything :sleep: … and i just cant figure out why…

here is the PHP file (named sites.php):

```php

<?php
mysql_pconnect ("*EDIT", "*EDIT", "*EDIT");

mysql_select_db ("*EDIT");
$qResult = mysql_query ("SELECT * FROM sites ORDER BY id");
$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."&";

?>

```

(\* are all what they should be =) in the “real” PHP)  
I’ve also tried the PHP file and this is what it displays (&n=2&id0=1&&title0=blabla&&link0=http://www.lala.com&&id1=2&&title1=blabla2&&link1=http://www.sadfk.com&&) So that means it’s workin’ (right?!), but there is somethin’ wrong with the SWF file…

and then some AS (from a file named sites.as):

```auto

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");

```

(yes, i’ve doubble checked… the dynamic text fields instansname is sites\_txt in the FLA file)  
And then thats pretty much it… anyOne :bu:

---

<div class="post-metadata">

**Author:** ![ckbliss](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@ckbliss](https://forum.kirupa.com/u/ckbliss)\
**Post date:** [April 17, 2006, 7:45pm UTC](https://forum.kirupa.com/t/from-mysql-to-flash-with-php-help/158125/2 "2006-04-17T19:45:22Z")

</div>

I also spent a good bit of time pouring over the code.

A good fix can be found in this thread:  
[http://www.kirupa.com/forum/showthread.php?t=189102](http://www.kirupa.com/forum/showthread.php?t=189102)
