title: Updating row in database puts wrong value inside the columns
body: <p>I have a working database in my android application. I can add rows without a problem. But when I try to update a row, the database puts the wrong values in the columns. </p>
  
  <p>I have gone through the code plenty of times but I can't find the problem, I probably looked at it so much that I can't see the obvious problem. The problem is that when updating the database row. the values get put in the wrong column. Every column gets filled with the new data. but they are not in the correct column. </p>
  
  <p>Here is an example:</p>
  
  <pre><code>// Inserting row into database gives this correct result
  example: | id | column1 | column2 | column3 | column4 | column5 |
           | 1  | value1  | value2  | value3  | value4  | value5  |
  
  // after updating the row i get this bad result:
  example: | id | column1 | column2 | column3 | column4 | column5 |
           | 1  | value1  | value2  | value5  | value3  | value4  |
  </code></pre>
  
  <p>I have a listview shows the database column1´s value, then send the rest of the columns to another activity. think of it as a contact list in the listview and when clicking on a contact the rest of the information is show. </p>
  
  <p>I send the data with this:</p>
  
  <pre><code>      EditContact.putExtra(MyContacts.ROW_ID, rowID);
        EditContact.putExtra("PHONE", phoneTextView.getText());
        EditContact.putExtra("EMAIL", emailTextView.getText());
        EditContact.putExtra("ADRESS", adressTextView.getText());          
        EditContact.putExtra("NAME", nameTextView.getText());
        EditContact.putExtra("COMMENT", commentTextView.getText());
        startActivity(EditContact); // start the Activity
  </code></pre>
  
  <p>in the EditContact activity i get the information like this and put the information in EditTexts.</p>
  
  <pre><code>    if (extras != null) {
          rowID = extras.getLong("row_id");
          phoneEditText.setText(extras.getString("PHONE"));
          emailEditText.setText(extras.getString("EMAIL"));
          adressEditText.setText(extras.getString("ADRESS"));
          nameEditText.setText(extras.getString("NAME"));
          commentEditText.setText(extras.getString("COMMENT"));
      }
  </code></pre>
  
  <p>I then save the information in the database like this:</p>
  
  <pre><code>         String phone   =   phoneEditText.getText().toString();
           String email   =   emailEditText.getText().toString();
           String adress  =   adressEditText.getText().toString(); 
           String name    =   nameEditText.getText().toString();
           String comment =   commentEditText.getText().toString();                 
       String spinner1 = (String) spinner1.getSelectedItem();
       String spinner2 = (String) spinner2.getSelectedItem();
       String spinner3 = (String) spinner3.getSelectedItem();
  
   databaseConnector.updateContact(rowID, spinner1, spinner2, spinner3, phone, email, adress, name, comment);
  </code></pre>
  
  <p>As you see I have three spinners here. I also have that when I add contact to database. and they gets inserted into the correct column even after update. these spinners gets translated to text in the viewcontact activity. </p>
  
  <p>This is how I update the database in the DatabaseConnector</p>
  
  <pre><code>public void updateContact(long id, String spinner1, String spinner2, String spinner 3, String phone, String email, String adress, String name, String comment)
  {
      ContentValues editContact = new ContentValues();
      editContact .put("SPINNER1", spinner1);
      editContact .put("SPINNER2", spinner2);
      editContact .put("SPINNER3", spinner3);
      editContact .put("PHONE", phone);
      editContact .put("EMAIL", email);
      editContact .put("ADRESS", adress);
      editContact .put("NAME", name);
      editContact .put("COMMENT", comment);
  
      open();
      database.update(DATABASE_TABLE, editContact , "_id=" + id, null);
      close();
  } 
  </code></pre>
  
  <p>I would really appreciate if someone have any idea of what could be wrong. I simply can not see it. Although I'm new at this and still learning. Thank you</p>
  
  <p>every value gets inserted into the correct row that I'm editing. but in the wrong column, and I get no errors.</p>