datagrid populated from mysql dbase using php
There are three methods: loadvars, xml and flash remoting.
I have a great tutorial from Lee Brimlow but he only passes one column into a listbox.
I want various columns passed into a datagrid.
I'm not too sure how to amend the php code
<?PHP
$link = mysql_connect("Localhost","user","password");
mysql_select_db("cambridgekidsdb");
$query = 'SELECT * FROM trivia_user';
$results = mysql_query($query);
echo "<?xml version=\"1.0\"?>\n";
echo "<triviauser>\n";
while($line = mysql_fetch_assoc($results)) {
echo "<item>" . $line["user_name"] . "</item>\n";
}
echo "</triviauser>\n";
mysql_close($link);
?>
How do I "echo" out the other columns.
The flash AS3 code is:
var theXML:XML = new XML();
theXML.ignoreWhite = true;
theXML.onLoad = function() {
var nodes = this.firstChild.childNodes;
for(i=0;i<nodes.length;i++) {
theGrid.addItem(nodes.firstChild.nodeValue,i);
}
}
theXML.load("http://www.cambridgekids.es/trivia_user.php");
I'm almost there and this will be fundamental to my website as I can create important stats on hundreds of children.
Thank you in advance.