0 Replies Latest reply on Aug 18, 2010 1:36 PM by Darkotylar

    SQLite update problem

    Darkotylar

      hello

       

      My table update code doesn't seem to be working and I cant figure out why... it doesn't give me any errors. When I run the AIR application and update my table it would sometimes delete the entry when I run the application again or it will put a "0" as the value where I did update.

       

      Here is my update code:

       

      private function updatePersonToDatabase(person:Person):void{
                     
                      var sqlUpdate:String = "Update Person set address='"+person.address+"' and name='"+person.name+"' and telephone='"+person.telephone+"' and email='"+person.email+"' where num='"+person.num+"';";
                      trace("sqlUpdate="+sqlUpdate);
                      dbStatement.text = sqlUpdate;
                      dbStatement.removeEventListener(SQLEvent.RESULT, onDBStatementInsertResult);
                      dbStatement.addEventListener(SQLEvent.RESULT, onDBStatementUpdateResult);
                      dbStatement.execute();
                  }

       

      Any help will be appreciated.

      Thanks