2 Replies Latest reply on Jan 9, 2008 3:52 PM by dazweeja

    Flex, PHP, MySQL Best Practices?

    Dan McAdam Level 1
      When using the HTTPService to invoke PHP/ database transactions what are some best practices to insure multiple simultaneous users successfully complete the transaction?

      So, in my Actionscript I build an object to pass to the PHP script that uses the values of the object to build a SQL query and executes the query, evaluating the result.

      Right now, I'm returning a text string from the PHP script (after error checking there) that simply says "ok" if the script succeeded.. and using that string in the HTTPService.Result (lastResult) listener.

      Anyone have any experiences to comment on?

      thanks,
      Dan
        • 1. Re: Flex, PHP, MySQL Best Practices?
          bfd02886
          My suggestion would be to return XML instead of "just" a string. Then you could provide yourself a return code and check to make sure that the SQL statements worked successfully. If you PHP code fails during the SQL code you can return XML that can be parsed by your application.

          Just my 2 cents.
          Bryan
          • 2. Re: Flex, PHP, MySQL Best Practices?
            dazweeja
            Or use AMFPHP and pass typed objects back and forth. I find this much easier than working with XML. Once you've used AMFPHP on one project, you'll wonder why you bothered with XML. Or at least that's how it was for me. AMFPHP 2.0 should be released very soon - I believe they're just getting the docs ready.

            Cheers,
            Darren.