logo-dw

Go Back   Dreamweaver Club Forums > Graphic Design > Flash
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 02-15-2009, 08:09 PM   #1
cocoonfx
cocoonfx's Avatar
 
Join Date: Nov 2006
Location: Tamworth,UK
Posts: 576
Default MySQL and Flash

Hello Chaps


I have been trying to link flash to a basic mysql database, but i am not having much luck. I have also tried some on line tutorials.

I have a php file with an xml section, and then i have a flash file which calls the XML. The php works but the flash does not. I have checked the action script and this is fine. Any ideas?

PHP code below

Code:
<?php
$dbh=mysql_connect ("localhost", "user", "pword");
mysql_select_db ("db");

$query	=("SELECT * FROM test");
$result =mysql_query($query,$dbh);
///$rowA = mysql_fetch_array($result);

echo "<?xml version=\"1.0\"?>\n";
echo "Comment\n";

while($line = mysql_fetch_assoc($result)) {
echo "<item>".$line["Comment"]."</item>\n";
}
echo "</Comment>\n";

mysql_close($dbh);

?>

Action Script.

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[i].firstChild.nodeValue,i);
	}
}

theXML.load("http://www.cocoonfxmedia.co.uk/cms/sites.php");

Last edited by Corrosive; 02-16-2009 at 07:39 AM.. Reason: wrapped code
cocoonfx is offline   Reply With Quote
Old 02-16-2009, 02:07 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

im really not sure about this as I am having an issue also but do you not have to use fwrite to make a new xml document?
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 02-19-2009, 11:44 AM   #3
cocoonfx
cocoonfx's Avatar
 
Join Date: Nov 2006
Location: Tamworth,UK
Posts: 576
Default

I am not sure, i was hoping to use xml with php and action script but it just does not work. All the tutorials i have tried are very good.... i would love to know how to do this.....
cocoonfx is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:54 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com