title: getting row id from sqlite using other fields as where condition
body: <p>sir, how can i return the rowid of my database depending on the inputs name, number? this code just return the value 0 everytime. my primary key is KEY_ROWID. thanks for help in advance</p>
  
  <pre><code>//get rowid
  public long getRowId(String name, String number) 
  {
      // TODO Auto-generated method stub
      String[] columns = new String[]{KEY_ROWID, KEY_NAME, KEY_NUMBER};
      Cursor c = ourDatabase.query(DATABASE_TABLE, columns, KEY_NUMBER+ "=" +number, null, null, null, null);
  
      long rowid = c.getColumnIndex(KEY_ROWID);
      return rowid;
  }
  </code></pre>
  
  <p>here is how i access it</p>
  
  <pre><code>public void onClick(View arg0) {
              nameChanged = sqlName.getText().toString();
              numChanged = sqlNumber.getText().toString();
              GroupDb info = new GroupDb(EditDetails.this);
              info.open();
              long rowid = info.getRowId(name, num);
              info.updateNameNumber(rowid, nameChanged, numChanged);
              Toast.makeText(getApplicationContext(), rowid+" "+nameChanged+" "+numChanged, Toast.LENGTH_LONG).show();
              ArrayList&lt;Contact&gt; searchResults = info.getView();
              MyCustomBaseAdapter mcba = new MyCustomBaseAdapter(EditDetails.this, searchResults);
              mcba.updateResults(searchResults);
              Toast.makeText(getApplicationContext(), "Update Successful!", Toast.LENGTH_LONG).show();
              info.close();
              }
          });
  </code></pre>