7 Replies Latest reply on Apr 19, 2007 6:29 AM by Newsgroup_User

    Looking for Xtra for MySql

    Level 7
      Hi everybody!

      I need to find an xtra to communicate with an MySql database sitting on a
      web server. The application will also be running on the same server on the
      Internet (Shockwave)

      Any suggestions for an Xtra? I have tried several but none of them seem to
      be Shockwave safe.

      Your help in this matter would be greatly appreciated!

      Bobby


        • 1. Re: Looking for Xtra for MySql
          Level 7
          You don't need an extra xtra for this. Just use a glue language like php or
          asp to talk to the db. Then use getnettext for instance to send queries.


          "Bobby Smith" <bobby@bobbysmith.com> wrote in message
          news:f039ir$80c$1@forums.macromedia.com...
          > Hi everybody!
          >
          > I need to find an xtra to communicate with an MySql database sitting on a
          > web server. The application will also be running on the same server on
          > the Internet (Shockwave)
          >
          > Any suggestions for an Xtra? I have tried several but none of them seem
          > to be Shockwave safe.
          >
          > Your help in this matter would be greatly appreciated!
          >
          > Bobby
          >


          • 2. Re: Looking for Xtra for MySql
            Level 7
            I have tried that but this seems like such a SLOW method... maybe I am doing
            something wrong or there is a way to speed things up... here is the code I
            am using:

            global gNetID1

            on prepareFrame me
            myuser=member("username").text
            set gNetID1 = getNetText
            ("http//www.MyWebAddress.com/authorize.php?myuser="&myuser)
            end prepareFrame me

            on exitFrame me
            if netDone(gNetID1) then
            set the text of member "results" = netTextResult(gNetID1)
            go to the frame "usermenu"
            else
            go to the frame
            end if
            end exitFrame me

            My PHP code looks like this:

            <?php
            $myuser=$_GET['myuser'];

            $con = mysql_connect("localhost", "myDBusername", "myDBpassword");
            mysql_select_db("mydatabase", $con);
            $query = "SELECT * FROM `user` WHERE `userid` = '$myuser'";

            $result = mysql_query($query) or die(mysql_error());


            $row = mysql_fetch_array($result) or die(mysql_error());
            echo $row['data1']. ",". $row['data2']. ",".$row['data3'].
            ",".$row['data4']. ",".$row['data5'];

            mysql_close($con);
            ?>


            The function is to submit a username via Director, query the mysql database
            and return the entire row of data associated with that username. When
            running from the address bar, it works perfectly and very quickly....

            Any help is greatly appreciated!!!!







            "tr" <timmr3-nospam-@excite.com> wrote in message
            news:f03acn$90m$1@forums.macromedia.com...
            > You don't need an extra xtra for this. Just use a glue language like php
            > or asp to talk to the db. Then use getnettext for instance to send
            > queries.
            >
            >
            > "Bobby Smith" <bobby@bobbysmith.com> wrote in message
            > news:f039ir$80c$1@forums.macromedia.com...
            >> Hi everybody!
            >>
            >> I need to find an xtra to communicate with an MySql database sitting on a
            >> web server. The application will also be running on the same server on
            >> the Internet (Shockwave)
            >>
            >> Any suggestions for an Xtra? I have tried several but none of them seem
            >> to be Shockwave safe.
            >>
            >> Your help in this matter would be greatly appreciated!
            >>
            >> Bobby
            >>
            >
            >


            • 3. Re: Looking for Xtra for MySql
              Level 7
              For the most part, I would expect the data to come from the web at the same
              speed browser or Director. Updating text fields is sometimes slow, so the
              line with "set the text" may be making it seem slower. How much longer is it
              taking?

              "Bobby Smith" <bobby@bobbysmith.com> wrote in message
              news:f03ec5$e24$1@forums.macromedia.com...
              >I have tried that but this seems like such a SLOW method... maybe I am
              >doing something wrong or there is a way to speed things up... here is the
              >code I am using:
              >
              > global gNetID1
              >
              > on prepareFrame me
              > myuser=member("username").text
              > set gNetID1 = getNetText
              > ("http//www.MyWebAddress.com/authorize.php?myuser="&myuser)
              > end prepareFrame me
              >
              > on exitFrame me
              > if netDone(gNetID1) then
              > set the text of member "results" = netTextResult(gNetID1)
              > go to the frame "usermenu"
              > else
              > go to the frame
              > end if
              > end exitFrame me
              >
              > My PHP code looks like this:
              >
              > <?php
              > $myuser=$_GET['myuser'];
              >
              > $con = mysql_connect("localhost", "myDBusername", "myDBpassword");
              > mysql_select_db("mydatabase", $con);
              > $query = "SELECT * FROM `user` WHERE `userid` = '$myuser'";
              >
              > $result = mysql_query($query) or die(mysql_error());
              >
              >
              > $row = mysql_fetch_array($result) or die(mysql_error());
              > echo $row['data1']. ",". $row['data2']. ",".$row['data3'].
              > ",".$row['data4']. ",".$row['data5'];
              >
              > mysql_close($con);
              > ?>
              >
              >
              > The function is to submit a username via Director, query the mysql
              > database and return the entire row of data associated with that username.
              > When running from the address bar, it works perfectly and very quickly....
              >
              > Any help is greatly appreciated!!!!
              >
              >
              >
              >
              >
              >
              >
              > "tr" <timmr3-nospam-@excite.com> wrote in message
              > news:f03acn$90m$1@forums.macromedia.com...
              >> You don't need an extra xtra for this. Just use a glue language like php
              >> or asp to talk to the db. Then use getnettext for instance to send
              >> queries.
              >>
              >>
              >> "Bobby Smith" <bobby@bobbysmith.com> wrote in message
              >> news:f039ir$80c$1@forums.macromedia.com...
              >>> Hi everybody!
              >>>
              >>> I need to find an xtra to communicate with an MySql database sitting on
              >>> a web server. The application will also be running on the same server
              >>> on the Internet (Shockwave)
              >>>
              >>> Any suggestions for an Xtra? I have tried several but none of them seem
              >>> to be Shockwave safe.
              >>>
              >>> Your help in this matter would be greatly appreciated!
              >>>
              >>> Bobby
              >>>
              >>
              >>
              >
              >


              • 4. Re: Looking for Xtra for MySql
                Level 7
                About 30-45 seconds vs immediate when I use the command from the address
                bar... that is why I thought I was doing something wrong in regards to how I
                was calling it and getting the info back to Director....


                "tr" <timmr3-nospam-@excite.com> wrote in message
                news:f03ga2$gd0$1@forums.macromedia.com...
                > For the most part, I would expect the data to come from the web at the
                > same speed browser or Director. Updating text fields is sometimes slow, so
                > the line with "set the text" may be making it seem slower. How much longer
                > is it taking?
                >
                > "Bobby Smith" <bobby@bobbysmith.com> wrote in message
                > news:f03ec5$e24$1@forums.macromedia.com...
                >>I have tried that but this seems like such a SLOW method... maybe I am
                >>doing something wrong or there is a way to speed things up... here is the
                >>code I am using:
                >>
                >> global gNetID1
                >>
                >> on prepareFrame me
                >> myuser=member("username").text
                >> set gNetID1 = getNetText
                >> ("http//www.MyWebAddress.com/authorize.php?myuser="&myuser)
                >> end prepareFrame me
                >>
                >> on exitFrame me
                >> if netDone(gNetID1) then
                >> set the text of member "results" = netTextResult(gNetID1)
                >> go to the frame "usermenu"
                >> else
                >> go to the frame
                >> end if
                >> end exitFrame me
                >>
                >> My PHP code looks like this:
                >>
                >> <?php
                >> $myuser=$_GET['myuser'];
                >>
                >> $con = mysql_connect("localhost", "myDBusername", "myDBpassword");
                >> mysql_select_db("mydatabase", $con);
                >> $query = "SELECT * FROM `user` WHERE `userid` = '$myuser'";
                >>
                >> $result = mysql_query($query) or die(mysql_error());
                >>
                >>
                >> $row = mysql_fetch_array($result) or die(mysql_error());
                >> echo $row['data1']. ",". $row['data2']. ",".$row['data3'].
                >> ",".$row['data4']. ",".$row['data5'];
                >>
                >> mysql_close($con);
                >> ?>
                >>
                >>
                >> The function is to submit a username via Director, query the mysql
                >> database and return the entire row of data associated with that username.
                >> When running from the address bar, it works perfectly and very
                >> quickly....
                >>
                >> Any help is greatly appreciated!!!!
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >> "tr" <timmr3-nospam-@excite.com> wrote in message
                >> news:f03acn$90m$1@forums.macromedia.com...
                >>> You don't need an extra xtra for this. Just use a glue language like php
                >>> or asp to talk to the db. Then use getnettext for instance to send
                >>> queries.
                >>>
                >>>
                >>> "Bobby Smith" <bobby@bobbysmith.com> wrote in message
                >>> news:f039ir$80c$1@forums.macromedia.com...
                >>>> Hi everybody!
                >>>>
                >>>> I need to find an xtra to communicate with an MySql database sitting on
                >>>> a web server. The application will also be running on the same server
                >>>> on the Internet (Shockwave)
                >>>>
                >>>> Any suggestions for an Xtra? I have tried several but none of them
                >>>> seem to be Shockwave safe.
                >>>>
                >>>> Your help in this matter would be greatly appreciated!
                >>>>
                >>>> Bobby
                >>>>
                >>>
                >>>
                >>
                >>
                >
                >


                • 5. Re: Looking for Xtra for MySql
                  Level 7
                  > I thought I was doing something wrong in regards to how I
                  > was calling it and getting the info back to Director....

                  From the code you posted it looks as though you are starting a new
                  request every time #prepareFrame fires. Try changing your prepareFrame
                  handler to beginSprite (which only fires once when the playback head
                  meets a "new" sprite)
                  • 6. Re: Looking for Xtra for MySql
                    Level 7
                    That was it!!!

                    Thank you very much.... works perfectly now!

                    "Sean Wilson" <webforumsuser@macromedia.com> wrote in message
                    news:f03hcv$hmv$1@forums.macromedia.com...
                    >> I thought I was doing something wrong in regards to how I was calling it
                    >> and getting the info back to Director....
                    >
                    > From the code you posted it looks as though you are starting a new request
                    > every time #prepareFrame fires. Try changing your prepareFrame handler to
                    > beginSprite (which only fires once when the playback head meets a "new"
                    > sprite)


                    • 7. Re: Looking for Xtra for MySql
                      Level 7
                      Use flashremoting + amfphp + php



                      "Bobby Smith" <bobby@bobbysmith.com> дÈëÏûÏ¢ÐÂÎÅ:f039ir$80c$1@forums.macromedia.com...
                      > Hi everybody!
                      >
                      > I need to find an xtra to communicate with an MySql database sitting on a
                      > web server. The application will also be running on the same server on
                      > the Internet (Shockwave)
                      >
                      > Any suggestions for an Xtra? I have tried several but none of them seem
                      > to be Shockwave safe.
                      >
                      > Your help in this matter would be greatly appreciated!
                      >
                      > Bobby
                      >