title: Android: what is wrong with my query?
body: <p>DataBaseAdapter methods:</p>
  
  <pre><code>public long insertRecordCategory(String name, String device)
      {
          ContentValues cv = new ContentValues();
          cv.put(NAME, name);
          cv.put(DEVICE, device);
  
          if(!updateRecord(cv, device))
                  return db.insert(TABLE, null, cv);
          else return 0;
      }
  
      private boolean updateRecord(ContentValues values, String device) {
          return db.update(TABLE, values, DEVICE + "=" + device, null) &gt; 0;
      }
  
      public String isDeviceRegistered(String device) {
          String [] coloane = {NAME, DEVICE};
          Cursor c = db.query(true, TABLE, coloane, DEVICE + "=" + device, null, null, null, null, null);
          if(c == null)
              return null;
          c.moveToFirst();
          return c.getString(c.getColumnIndex(NAME));
      }
  </code></pre>
  
  <p>When I'm trying to call: isDeviceRegistered it says: </p>
  
  <p><code>05-25 16:44:47.170: E/AndroidRuntime(14504): android.database.sqlite.SQLiteException: near ":02": syntax error (code 1): , while compiling: SELECT DISTINCT _name, _device FROM FriendsTable WHERE _device=22:02:af:db:24:9a</code></p>
  
  <p>When calling update it says:</p>
  
  <pre><code>05-25 17:36:55.190: E/AndroidRuntime(469): android.database.sqlite.SQLiteException: near ":02": syntax error (code 1): , while compiling: UPDATE FriendsTable SET device=?,name=? WHERE device=22:02:af:db:24:9a
  </code></pre>
  
  <p>And this update method is the same one form another project where it worked.</p>