1 Reply Latest reply on Aug 11, 2006 2:34 PM by everynewday

    using PHP to query MySQL Database

    everynewday Level 1
      I'm using PHP to query a MySQL database. In this particular instance, it's retrieving song names and urls to load into a Media Controller. Here's the pertinent Actionscript:

      thisButton.onRelease = function() {
      dbQuery.action = 'getSong';
      dbQuery.bandId = 25;
      dbQuery.sendAndLoad(" http://localhost/mysite/dbquery2.php?ck="+new Date().getTime(), getSong);
      //trace(dbQuery); // traces bandId=25&action=getSong
      }

      function gotSong(theTarget:LoadVars):Void {
      trace(theTarget);
      }

      var dbQuery:LoadVars = new LoadVars();
      var getSong:LoadVars = new LoadVars();
      getSong.onLoad = gotSong;

      the gotSong function simply traces "true".

      The PHP script is attached, if it helps.