Check if string is in database?

view story

http://stackoverflow.com – I'm looking for a simple way to check the rows in the database if the imagePath is equal to the column TABLE_IMAGE_PATH. First I was thinking of doing a loop and began with a request to check how many rows there are in the table, but then I got lost! And I guess there is better ways to do this with perhaps Do While?! Preciate some help! // Check if image is in db public boolean readImage(String imagePath) { // Check number of rows in db int rows = getNumRows(); Cursor c = db.query(DB_TABLE, columns, TABLE_IMAGE_PATH + "=" + imagePath, null, null, null, null); return fal (HowTos)