# MySQL / PHP / XML / Flash

**URL:** https://forum.kirupa.com/t/mysql-php-xml-flash/172957
**Category:** programming
**Created:** [December 19, 2005, 9:59pm UTC](https://forum.kirupa.com/t/mysql-php-xml-flash/172957 "2005-12-19T21:59:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![robmcfeters](https://avatars.discourse-cdn.com/v4/letter/r/e36b37/32.png) [@robmcfeters](https://forum.kirupa.com/u/robmcfeters)
#### Post date: [December 19, 2005, 9:59pm UTC](https://forum.kirupa.com/t/mysql-php-xml-flash/172957/1 "2005-12-19T21:59:11Z")

</div>

maybe someone can help me with this.  
I have rows in a table called “shows” in my database. I want to Flash to show and order that entire table.

so I made this PHP script:

> 

\<?php  
$connection=mysql\_connect(“localhost”, “user”, “password”);  
mysql\_select\_db(user, $connection) or die(‘Could not select table’);  
$result = mysql\_query(“SELECT \* FROM shows ORDER BY timestamp ASC”);

echo "\<?xml version="1.0"?\>  
";  
echo "\<shows\>  
";

while($r=mysql\_fetch\_array($result)) {  
$date = $r[‘timestamp’];  
$day = date(“l m/d/Y”,$date);  
$city = $r[‘city’];  
$state = $r[‘state’];  
$venue = $r[‘venue’];  
$bands = nl2br($r[‘bands’]);  
$time = $r[‘time’];  
$cost = $r[‘cost’];  
echo "\<each\>  
$day\<br /\>$city, $state\<br /\>@ $venue\<br /\>$bands\<br /\>$time - $cost\<br /\>\<br /\>  
\</each\>  
";  
}  
echo "\</shows\>  
";  
mysql\_close();  
?\>

I uploaded that PHP file, checked it out, and it worked. So I viewed the source and glad to see this:

> \<?xml version=“1.0”?\>  
> \<shows\>  
> \<each\>  
> Thursday 12/22/2005\<br /\>Denver, CO\<br /\>@ Rex\<br /\>Me\<br /\>  
> First STrickekl\<br /\>  
> Heck!\<br /\>4:00 - $30\<br /\>\<br /\>  
> \</each\>  
> \<each\>  
> Monday 12/26/2005\<br /\>Fargo, ND\<br /\>@ Georg’es\<br /\>band1\<br /\>  
> band2\<br /\>  
> band3\<br /\>  
> band4\<br /\>4:00 - $20\<br /\>\<br /\>  
> \</each\>  
> \</shows\>

so far so good. that means my PHP script successfully pulled the rows  
out of the table I selected, and formatted it in XML.

My problem is that I can’t load it in flash.  
here is my actionscript:

> 

shows = new XML();  
shows.ignoreWhite = true;  
shows.load(‘[http://www.watchyouburn.com/projects/test.php](http://www.watchyouburn.com/projects/test.php)’);  
shows.onLoad = function() {  
XMLOut(this);  
};  
function XMLOut(xml\_file) {  
for (a=0; a\<xml\_file.firstChild.childNodes.length; a++) {  
for (z=0; z\<xml\_file.firstChild.firstChild.childNodes.length; z++) {  
lister.htmlText = (xml\_file.firstChild.childNodes[a].childNodes[z].firstChild.nodeValue);  
}  
}  
}

“lister” being the dynamic text field that I would like my information to show up in.  
when I test the movie…the text field just says “undefined”.

I’m stuck.

any help would be appreciated.
