title: How to check multiple columns in Sqlite using Where clause?
body: <p>I am new to SqLite Databases and queries. I want to check where both latitude and longitude of a location is stored in the database. I am passing my latitude and longitude values from a activity to a function in my database class. I tried using  </p>
  
  <pre><code> c = db.rawQuery("select latitude,longitude from savedlocation (where latitude = ? and 
     longitude = ?) ", new String[] {String.valueOf(latitude),String.valueOf(longitude)});  
  </code></pre>
  
  <p>but it doesn't help.</p>
  
  <p>Can anyone suggest me what modification in the code should I do.<br>
  My codes are as follows:</p>
  
  <pre><code>public int isUserAvailable(Double latitude)
  {
   int number = 0;
  Cursor c = null;
  try
  {
      c = db.rawQuery("select latitude,longitude from savedlocation where latitude = ? ", new String[] {String.valueOf(latitude)});
  
      if(c.getCount() != 0)
          number = c.getCount();
  }
  catch(Exception e) {
      e.printStackTrace();
  } finally {
      if(c!=null) c.close();
  }
  return number;
   }
  </code></pre>
  
  <p>and I am calling the function using</p>
  
  <pre><code> int n=db.isUserAvailable(latitude);
  </code></pre>