Check if string is in database?
<p>I'm looking for a simple way to check the rows in the database if the <code>imagePath</code> is equal to the column <code>TABLE_IMAGE_PATH</code>. 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 <code>Do While</code>?! Preciate some help!</p>

<pre><code>    // 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 false;
}
</code></pre>
