I want to check if there are already 5 rows in my database, but I can't use the execSQL method to call SELECT because it returns void and nothing else seems to fit in an if statement. So is there a simple fix or do I have to go about this another way?
//add a new row to the database
public void addProduct(Products product){
SQLiteDatabase db = this.getWritableDatabase();
if(db.execSQL("SELECT Count * FROM " + TABLE_PRODUCTS) == 5){
ContentValues values = new ContentValues();
values.put(COLUMN_PRODUCTNAME, product.get_productname());
db.insert(TABLE_PRODUCTS, null, values);
db.close();
}
}