# 6 records from msql server into flash

**URL:** <https://forum.kirupa.com/t/6-records-from-msql-server-into-flash/243202>\
**Category:** programming\
**Created:** [November 4, 2007, 9:29am UTC](https://forum.kirupa.com/t/6-records-from-msql-server-into-flash/243202 "2007-11-04T09:29:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Novate](https://avatars.discourse-cdn.com/v4/letter/n/3bc359/32.png) [@Novate](https://forum.kirupa.com/u/Novate)\
**Post date:** [November 4, 2007, 9:29am UTC](https://forum.kirupa.com/t/6-records-from-msql-server-into-flash/243202/1 "2007-11-04T09:29:03Z")

</div>

Greetings,

as i created mysql database using wamp server, i created a table with 6 products in it,  
and php file creates an xml file with text which is finally loaded into flash, it loads all the text into 1 single ‘list’ component, it works nicely

but all the text is all grouped in 1 single component

but what im trying to do is to separate each record to load in a separate text field  
and finally i need to load an image with each record, i realize that each image must be linked from xml file

here is my php code that creates the xml file:

```php
<?PHP

$link = mysql_connect("localhost","lee","password");
mysql_select_db("brimelow_store");

$query = 'SELECT * FROM products';
$results = mysql_query($query);

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

while($line = mysql_fetch_assoc($results)) {
    echo "<item>" . $line["product"] . "</item>
";
}

echo "</products>
";

echo "<image>
";

echo "http://localhost/logo/logo1.jpg";

echo "</image>
";

mysql_close($link);

?>

```

here is my actionscript:

> var theXML:XML = new XML();  
> theXML.ignoreWhite = true;

theXML.onLoad = function() {  
var nodes = this.firstChild.childNodes;  
for(i=0;i\<nodes.length;i++) {  
theList.addItem(nodes\*.firstChild.nodeValue,i);  
my\_products.addItem(nodes\*.firstChild.nodeValue,i);  
txt\_products.text = \_root.my\_products;  
}  
}

theXML.load(“[http://localhost/products.php](http://localhost/products.php)”);  
what am i doing wrong?

currently everything works fine (except of the image loading)  
and all the 6 records is grouped into 1 single ‘list’ component

how could i load these 6 records into 6 individual text fields? + image in each record

i’ve been working on this for few days now, i haven’t had a proper rest its killing me

anyone? any suggestions?
