2 Replies Latest reply on Jul 8, 2010 3:48 AM by djh88ukwb

    AMFPHP  Update problem

    djh88ukwb Level 1

      Hello All,

       

      I am using AMFPHP and trying to update a record in a database.

       

      My database contains teh following fields,  "ref" "username" "password" "locked"

       

      I am then using this PHP code

       

      <?php
      class jobs
      {
      var $db_host = 'localhost';
      var $db_name = 'videochat';
      var $db_user = 'videochatadmin';
      var $db_pwd = '24627930';
      var $ID_No = '7';

      function jobs()
      {
      $this->methodTable = array(
      "getJobs" => array(
      "description" => "Info Database",
      "access" => "remote"
      )
      );
      }


      function update($ref)
      {
      $mysql = mysql_connect($this->db_host, $this->db_user, $this->db_pwd);
      mysql_select_db( $this->db_name);
      $sql = "UPDATE usernames SET locked ='yes' WHERE ref ='$ref'";

      }

      }


      ?>

       

      But when using the AMFPHP browser, or by callling the script form my app, it dosent change the record.

       

      I have even tried making a standalone php script to see if i can run that and change it, but that dosent work either

       

      <?php
      $hostname_conn = "localhost";
          $username_conn = "";
          $password_conn = "";

          $conn = mysql_connect($hostname_conn, $username_conn, $password_conn);

          mysql_select_db("users");


          $sql = 'UPDATE `videochat`.`usernames` SET `locked` = \'yes\' WHERE `usernames`.`ref` = 47 LIMIT 1;';

      ?>

       

      Any idea's on how i can get it to work ?  I would rather use a standalone PHP script, much the same as the one above, as i will be able to pass variables into it easier using HTTPService in flex,  but as i say, i cant get it to edit the database . . . .