0 Replies Latest reply on Feb 28, 2010 10:13 AM by Scott R. Hamilton

    LAST_INSERT_ID() delivers 0 as result

    Scott R. Hamilton Level 1

      I'm attemping to insert a record into a mySQL table and to get the primary key of the

      inserted record. According to the mySQL documentation using this query after the

      insert should give the auto incremented key of the inserted record:


      SELECT LAST_INSERT_ID() as LastId;


      This works fine in the SQL monitor in mySQL -  INSERT.. followed by

      SELECT LAST_INSERT... delivers the primary key of the just inserted



      When I execute the two queries from ActionScript, I get 0 as a result in




      So the returned data structure has the element LastId added to it, as per

      my query but the value is not correct.


      Has anyone had and solved this issue in AS?