title: Problem with inserting new record to sqlite in android studio
body: <p>I want to insert a new record into a sqlite db.
  My table is called <code>words</code>. It has the columns <code>id</code>, <code>word</code>, <code>meaning</code>, <code>details</code>, <code>lesson</code>, <code>ticks</code>.  </p>
  
  <p>When I try to insert a new record, it just saves <code>details</code> as <code>word</code> and <code>lesson</code> as <code>meaning</code>, whereas <code>details</code> and <code>lesson</code> are stored with a null value.
  The autoincrement primary key <code>id</code> and <code>ticks</code> are stored correctly.</p>
  
  <hr>
  
  <h1>Code</h1>
  
  <h3>Handler:</h3>
  
  <pre><code>public class DatabaseHandler extends SQLiteOpenHelper {
  
  private static final int DATABASE_VERSION = 1;
  protected static final String DATABASE_NAME = "wordDatabase";
  
  public DatabaseHandler(Context context) {
      super(context, DATABASE_NAME, null, DATABASE_VERSION);
  }
  
  @Override
  public void onCreate(SQLiteDatabase db) {
  
      String sql = "CREATE TABLE words " +
              "( id INTEGER PRIMARY KEY AUTOINCREMENT, " +
              "word TEXT, " +
              "meaning TEXT, " +
              "details TEXT, " +
              "lesson TEXT, " +
              "ticks INTEGER ) ";
      db.execSQL(sql);
  
  }
  
  @Override
  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
  
      String sql = "DROP TABLE IF EXISTS words";
      db.execSQL(sql);
      onCreate(db);
  }
  </code></pre>
  
  <h3>Object:</h3>
  
  <pre><code>    public class ObjectStudent {
          int id;
          String word;
          String meaning;
          String details;
          String lesson;
          int ticks;
  
      public ObjectStudent(){
  
      }
  </code></pre>
  
  <h3>OnClickListener:</h3>
  
  <pre><code>public class OnClickeListenerCreateStudent implements View.OnClickListener {
  @Override
  public void onClick(View view) {
      final Context context = view.getRootView().getContext();
  
      LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      final View formElementsView = inflater.inflate(R.layout.student_input_form, null, false);
  
      final EditText et_word = (EditText) formElementsView.findViewById(R.id.et_word);
      final EditText et_meaning = (EditText) formElementsView.findViewById(R.id.et_meaning);
      final EditText et_details = (EditText) formElementsView.findViewById(R.id.et_details);
      final EditText et_lesson = (EditText) formElementsView.findViewById(R.id.et_lesson);
  
  
      new AlertDialog.Builder(context)
              .setView(formElementsView)
              .setTitle("Create Word")
              .setPositiveButton("Add",
                      new DialogInterface.OnClickListener() {
                          public void onClick(DialogInterface dialog, int id) {
                              String wordTitle = et_word.getText().toString();
                              String wordMeaning = et_meaning.getText().toString();
                              String wordDetails = et_details.getText().toString();
                              String wordLesson = et_lesson.getText().toString();
  
                              ObjectStudent objectStudent = new ObjectStudent();
                            /*  objectStudent.word= wordTitle;
                              objectStudent.meaning= wordMeaning;
                              objectStudent.details= wordDetails;
                              objectStudent.lesson= wordLesson;*/
                              objectStudent.word = "word"; // et_word.getText().toString();
                              objectStudent.meaning = "meaning"; // et_meaning.getText().toString();
                              objectStudent.details = "details"; // et_details.getText().toString();
                              objectStudent.lesson = "lesson"; // et_lesson.getText().toString();
  
                              objectStudent.ticks= 1;
  
                              boolean createSuccessful = new TableControllerStudent(context).create(objectStudent);
  
                              if(createSuccessful){
                                  Toast.makeText(context, "Word information was saved.", Toast.LENGTH_SHORT).show();
                              }else{
                                  Toast.makeText(context, "Unable to save Word information.", Toast.LENGTH_SHORT).show();
                              }
  
                              ((MainActivity) context).countRecords();
                              ((MainActivity) context).readRecords();
  
  
  
                              dialog.cancel();
                          }
  
                      }).show();
  }
  </code></pre>
  
  <h3>Create method on <code>TableControllerStudent</code> class:</h3>
  
  <pre><code>public class TableControllerStudent extends DatabaseHandler {
  
  public TableControllerStudent(Context context) {
      super(context);
  }
  
  public boolean create(ObjectStudent objectStudent) {
  
      ContentValues values = new ContentValues();
  
  
    /*  values.put("word", objectStudent.word);
      values.put("meaning", objectStudent.meaning);
      values.put("details", objectStudent.details);
      values.put("lesson", objectStudent.lesson);*/
  
      values.put("word", "w");
      values.put("meaning", "m");
      values.put("details", "d");
      values.put("lesson", "l");
  
      values.put("ticks", objectStudent.ticks);
  
      SQLiteDatabase db = this.getWritableDatabase();
  
      db.execSQL("INSERT INTO " + "words "+ "(word, meaning,details, lesson, ticks ) VALUES ('word','meaning','details','lesson',2)");
  
      //boolean createSuccessful = db.insert("words", null, values) &gt; 0;
      db.close();
  
      //return createSuccessful;
      return true;
  }
  </code></pre>