title: SQLite Exception no such column when trying to select
body: <p>I have the following DB helper class:</p>
  
  <pre><code>public int studentExists(String studid) {
      Cursor dataCount = mDb.rawQuery("select count(*) from usertable where " + KEY_STUDID + "=" + studid, null);
      dataCount.moveToFirst();
      int count = dataCount.getInt(0);
      dataCount.close();
      return count;
  }
  </code></pre>
  
  <p>I use this in my app to see if a student id has been previously entered.</p>
  
  <p>This works fine when the student id's are ints (346742) but whenever I try to add an alpha-numeric id (PB3874) it force closes the app.</p>
  
  <p>Error:</p>
  
  <blockquote>
    <p>06-13 18:22:20.554: ERROR/AndroidRuntime(8088): android.database.sqlite.SQLiteException: no such column: pb3874: , while compiling: select count(*) from usertable where studid=pb3874</p>
  </blockquote>
  
  <p>I don't think its a data type issue (because I use the text type):</p>
  
  <pre><code>    private static final String DATABASE_CREATE =
      "create table usertable (_id integer primary key autoincrement, "
      + "studid text not null);";
  </code></pre>
  
  <p>But I'm confused why the error is saying <code>no such column: pb3874</code> as I'm trying to simply select that value from the studid column.  And also why this works perfectly for any int value.  Anyone have any problem solving advice?</p>