title: getcount returning 0
body: <p>Hey guys this is my code to compare a name with something existing in the database already. However the getcount returns 0 all the time. Any help ? thanks !!</p>
  
  <pre><code>public String checkUserName(SQLiteDatabase db, String enteredName)
  
  {
  
          String selectionArgs[] = new String[1];
          selectionArgs[0] = enteredName;
          Cursor cursor = db.rawQuery("select * from table1 where user=?", selectionArgs);
          cursor.moveToFirst();
          return Integer.toString(cursor.getCount());
      }
  </code></pre>
  
  <p>The code i use to call the above function is :</p>
  
  <pre><code>    Intent intent = getIntent();
      TextView tv1 = new TextView(this);
      String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE)
  tv1.setText(db.checkUserName(db.getWritableDatabase(), message));
  relativeLayout.addView(tv1)
  </code></pre>
  
  <p>DB snapshot link :   <a href="http://i.stack.imgur.com/LnTbl.jpg" rel="nofollow">http://i.stack.imgur.com/LnTbl.jpg</a></p>