A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Benefits of XML vs. PHP/MySQL?

  1. #1

    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.
    I Flash, therefore I am.

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    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...
    Richard Lyman
    rich at lithinos.com
    www.lithinos.com

  3. #3
    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.
    I Flash, therefore I am.

  4. #4
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    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.
    Richard Lyman
    rich at lithinos.com
    www.lithinos.com

  5. #5
    Member
    Join Date
    Mar 2002
    Posts
    90
    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.

  6. #6
    Member
    Join Date
    Mar 2002
    Posts
    90
    please =(

  7. #7
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112
    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); 
    Richard Lyman
    rich at lithinos.com
    www.lithinos.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center