3 Replies Latest reply on Jul 5, 2007 9:28 AM by MotionMaker

    communicate php

    jonnybennett Level 1
      My site requires a lot of cuminacting with a mysql database and I am using php to do this. However occaisionally this communictaion seems to freeze, for like twenty seconds and then continue. I could understand if the query it was running was dragging out a lot of data, or was a diff query to the ones being run before, but it just happens on odd occassions and makes no sense.
      I know this is not a problem with the php, and it I am sure this isnt the server. (not experienced it with any other sites except flash ones that comunicate with database)

      Has anyone else had any expericence of the communication between flash and a database occassionally freezing for around 20 secs and then continuing???.

      Also I hear that the next version of flash wont require php to comunicate with a mysql database... has anyone tried this? does it result in faster interaction with the database.
        • 1. Re: communicate php
          MotionMaker Level 1
          Flash does not communicate with the mySQL database. It communicates with the web server that in turn provides data to PHP.

          So you can create a plain php script to send the data to the same php script that Flash is sending to isolate Flash from the problem.

          If you find the delay is gone, then you need to post the Flash code so we can see if there is something you are doing that would contribute to the delay such as some of the throttling code folks used to use back in the AS1 MX days.

          • 2. Re: communicate php
            jonnybennett Level 1
            Thanks Lon. for the response, but I don't think I fully understand what you mean?.
            Do you mean that I should create a php script that sends the same flash vars to the php script that is comunictaing with the database to see if it is the flash that is causing the delay?
            The reason I am finding it to be strange is that this problem only occurs some times. eg... if I run the exact same A.S. to execute the exact same php script to comunicate with the database.... on the 20th time of doing it, it will pause for 20 secs before recieving the data... if it was struggling should it not struggle on every attempt?

            I thought I had read somewhere that the next version of flash would be able to comunicate with a database just using AS... but maybe I dreamt that?.

            thanks for yur response.
            • 3. Re: communicate php
              MotionMaker Level 1
              To determine if Flash is the problem, eliminate it from the testing.

              Create a HTML form to communicate with the current php script.

              Does it delay after 20 attempts? If so the problem is on the server side.

              Server side issue could be something as simple as a shared hosting service and you are seeing the peaks. Or it could be latency on a circuit from you to the server you might need to explore.

              As far as I know Flash will have to communicate with an intermediate server application to get to a database. You have scripting like ASP and PHP. You have remote services like AMF.