android sqlite query with multiple where

后端 未结 4 868
失恋的感觉
失恋的感觉 2020-12-30 03:40

Here\'s my current sqlite code:

Cursor c = sqlDatabase.rawQuery(\"select docid as _id, recipeID from \" + TABLE_RECIPE_NAME + 
                \" where \" +          


        
4条回答
  •  甜味超标
    2020-12-30 03:48

    change query to:

    Cursor c = sqlDatabase.rawQuery("select docid as _id, recipeID from " +
    TABLE_RECIPE_NAME + " where " + KEY_ownerID + " = ? AND " + KEY_partnerID +
    " = ? AND  " + KEY_advertiserID + " = ? AND " + KEY_chefID + " = ?",
    new String[] { ownerID, partnerID, advertiserID, chefID });
    

提交回复
热议问题