5 Replies Latest reply on Sep 15, 2008 2:54 AM by SujitG

    Flex and PHP/MySql

    EricEastman
      I have a website hosted with GoDaddy with a MySql database that I built.

      I want to create a new Flex project that can access this database.
      I know about the 'Create Application from Database' wizard.
      I'm trying to create a new Flex application that's web server enabled.
      In the 'Create a Flex Application' dialogue box I've filled in the project name and location, as well as selecting the application type as Web Application, and the Application server type as PHP. (I see the other options, but am assuming that PHP is the one I want)

      When I click Next, I get the 'Configure PHP Server' dialogue box.
      Here's where I get stuck. I don't know what to put in the Web Root and Root URL text boxes. Nothing that I've tried so far works when I check the 'Validate Configuration' button. (I've even called GoDaddy support to see if they might know anything, but got no help. I've also browsed in these forums, etc.

      Can someone point me in the right direction?
        • 1. Re: Flex and PHP/MySql
          Level 7

          "EricEastman" <webforumsuser@macromedia.com> wrote in message
          news:gabi1g$1m1$1@forums.macromedia.com...
          >I have a website hosted with GoDaddy with a MySql database that I built.
          >
          > I want to create a new Flex project that can access this database.
          > I know about the 'Create Application from Database' wizard.
          > I'm trying to create a new Flex application that's web server enabled.
          > In the 'Create a Flex Application' dialogue box I've filled in the project
          > name and location, as well as selecting the application type as Web
          > Application, and the Application server type as PHP. (I see the other
          > options,
          > but am assuming that PHP is the one I want)
          >
          > When I click Next, I get the 'Configure PHP Server' dialogue box.
          > Here's where I get stuck. I don't know what to put in the Web Root and
          > Root
          > URL text boxes. Nothing that I've tried so far works when I check the
          > 'Validate Configuration' button. (I've even called GoDaddy support to see
          > if
          > they might know anything, but got no help. I've also browsed in these
          > forums,
          > etc.
          >
          > Can someone point me in the right direction?

          I'd just build the php middle tier myself, rather than messing around with a
          wizard. Seems like you already have the skill.


          • 2. Re: Flex and PHP/MySql
            bitwyse Level 1
            So I don't agree with Amy on this one. ( I usually agree with what she says .;-) ).

            The wizards are pretty cool in the code that they generate. It needs to be organized better but it seems to do a good job. In my opinion.

            I"m not a PHP guy, rather I just play one on TV. That being said, I believe you must be running some sort of web server that is serving your PHP code. I believe that to be your web root folder. I am running a default install of wamp and during the install of wamp I configured my web root to be c:\wamp\www . If you put your application under a folder called acme ( which is under c:\wamp\www\acme ) then your root URL would be http://localhost/acme/index.html assuming your main entry point is index.html.

            That's my two cents worth. That and five bux will get you a cup of coffee @ Starbux.
            • 3. Re: Flex and PHP/MySql
              EricEastman Level 1
              bitwyse has a point. The code the wizards generate is interesting to analyse, and their style can be instructive.

              But I'm also interested, Amy, when you create a new project, using Adobe Flex Builder 3, do you always select 'None' in the 'Application server type:' drop down?
              • 4. Re: Flex and PHP/MySql
                Level 7

                "EricEastman" <webforumsuser@macromedia.com> wrote in message
                news:gadp9f$ioi$1@forums.macromedia.com...
                > bitwyse has a point. The code the wizards generate is interesting to
                > analyse,
                > and their style can be instructive.
                >
                > But I'm also interested, Amy, when you create a new project, using Adobe
                > Flex
                > Builder 3, do you always select 'None' in the 'Application server type:'
                > drop
                > down?

                Pretty much. But I admit I only have done one project that used PHP, and I
                was building the db as I went. It never seems you get everything in in your
                first design.


                • 5. Re: Flex and PHP/MySql
                  SujitG Level 2
                  Hi,

                  Setting the server type to PHP is required if you are using AMF PHP or any other PHP based services which have configuration files and will use the configuration files to replace the destinations with the end point URLs.

                  If you are not using any services like Remoting or Messaging which the AMFPHP or others provide, you can go ahead and select NONE in your server type and continue creating your project.

                  Coming to the database access part, if you are using HTTP Service to invoke the PHP page on the server, which in turn will do the database operations, just go ahead and use the HTTPService component in Flex and give the URL to the PHP page to the url property of the HTTPSerive component.

                  If you want to use Remoting to access the classes on the PHP, which in turn will do the database operations. Please use AMFPHP to invoke your PHP classes. Please find details on how to use AMFPHP and invoke classes at the URL below.

                  http://sujitreddyg.wordpress.com/2008/09/04/invoking-php-functions-from-flex-using-amfphp/

                  Hope this helps.