title: Why am I getting a -1 in getColumnIndex method
body: <pre><code> private static final String DATABASE_CREATE = "CREATE TABLE "
            + DATABASE_TABLE_USERS + "(" + KEY_ROW_ID + 
           " INTEGER PRIMARY KEY AUTOINCREMENT," + KEY_NAME
            + " TEXT NOT NULL," + KEY_PASSWORD + " TEXT NOT NULL," + KEY_LOGIN_ATTEMPTS + " INTEGER NOT NULL," + KEY_ZIP + " TEXT," +
            KEY_STREET + " TEXT," + KEY_EMAIL + " TEXT NOT NULL," + KEY_PHONE + " TEXT);";
  </code></pre>
  
  <p>I create the database in the on_create method:
         db.execSQL(DATABASE_CREATE);</p>
  
  <p>I have this method:</p>
  
  <pre><code> public int getLoginAttempts(String u_name) {
  
      String [] columns = new String [] {DB_Helper.KEY_NAME};
      Cursor c = database.query(DB_Helper.DATABASE_TABLE_USERS, columns, DB_Helper.KEY_NAME + "= ?",
               new String[] {u_name},
               null,
               null,
               null);
  
      if(!c.moveToFirst()) return -1;
  
      int c_index = c.getColumnIndex(DB_Helper.KEY_LOGIN_ATTEMPTS);
  
      int num = c.getInt(c_index);
      c.close();
      return num;
  }
  </code></pre>
  
  <p>c_index always equals -1. This means that the column doesn't exist. But it does. And there should only be one record coming back (for u_names are unique).</p>
  
  <p>How do I fix this?</p>