-
Benefits of XML vs. PHP/MySQL?
I am learning data handling using Flash as the interface. What are the benefits of using XML and Actionscript versus an SQL database and PHP scripting?
Tell me your preference, if any.
-
Uhm...
... is E. All of the above an option??
I actually use all of 'em.
Store the data in MySQL... grab it with PHP... send it out in XML ... display it in Flash.
If you're trying to decide between AS&XML vs. PHP&MySQL.. you'd be comparing Apples and Oranges. So don't decide between. Use all of them when appropriate...
-
Ok, more specifically (which I think you've answered)...
Is it better to call data into Flash from XML or MySQL?
And what would the round-trip process entail?
1) User enters data via Flash.
2) PHP moves data into MySQL.
3) User calls data via Flash.
4) PHP converts data from MySQL into XML.
5) Flash reads XML data.
Does this sound right? Remember, I'm a noob. I just read most of the MySQL manual though. Mai brein hertz.
-
Uhm...
Flash must 'call' a URL.
A URL meaning a script that generates a 'file' or an already existing 'file'.
Flash can not 'call' data from MySQL directly.
The process you outlined sounds correct, if I understand you...
INPUT:
PHP Code:
'User' -givesTo-> 'Flash' -givesTo-> 'PHP' -writesInTo-> 'MySQL'
OUTPUT:
PHP Code:
'User' -asksFrom-> 'Flash' -asksFrom-> 'PHP' -asksFrom-> 'MySQL' -answersTo-> 'PHP' -formatsInto-> ('XML' || 'name_value_pairs') -givesTo-> 'Flash' -displaysTo-> 'User'
I hope that made sense...
Last edited by VAYKENT; 11-06-2002 at 11:30 AM.
-
Can you/someone give me an example of how PHP can possibly format SQL data into an XML file? Thanks so much.. I've been dying to know.. can't find a resource anywhere to explain how this is done.
-
-
PHP Code:
$query="SELECT * FROM table WHERE ID='1'";
echo "<response>";
$result = mysql_query($query) or die ("<status>bad query</status>");
echo "<resultSet id='resultSet'>";
while ($r = mysql_fetch_assoc($result)) {
echo "<row>";
while (list ($key, $val) = each ($r)) {
echo "<$key><![CDATA[$val]]></$key>";
}
echo "</row>";
}
echo "</resultSet></response>";
mysql_free_result($result);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|