I am new to database and I am trying to get all the data from table whose category column is equal to 1. This is my first attempt. Can someone please guide me where I am doing wrong?
public Cursor getAllFamilyMovies()
{
return database.query("movies", new String[] {"_id", "name"},
"category=1", null, null, null, "name");
}
The "whereclause" and "whereargs" need to be separated as shown below:
public Cursor getAllFamilyMovies() {
return database.query("movies", new String[] {"_id", "name"}, "category = ?", new String[] {"1"}, null, null, "name");
}