SQLite .query() method, WHERE clause is only taking double quotes strings

前端 未结 6 607
执笔经年
执笔经年 2020-12-14 20:43

I have variable:

String owner=\"Mike\";
String[] columns ={\"quantity\", \"price\",\"owner\"}

My cursor is trying to get
Curso

6条回答
  •  盖世英雄少女心
    2020-12-14 21:15

     public Cursor show_vol(String  vol,String bk,String hadnu)
               { 
                  SQLiteDatabase db = this.getReadableDatabase();
                  String[] columns ={"hadith"};//colums name that you select
    
                  Cursor res = db.query("volume2", columns, "hadithno=?", new String[] { hadnu }, null, null, null);
    
     //volume2 is table name  and hadithno is colume name  l
    //select hadith from volume2 where hadithno=hadnu  //working like s
    
     1. List item
    
                  return res;
               }
    

提交回复
热议问题