android - query method in SQLiteDatabase -


i want know how use query method have where clause like property. want select columns c_name column keyword.

i've tried this, doesn't work:

cursor = db.query(table, null, c_name, new string[] {"like '"+keyword+"'"}, null, null, null); 

look @ docs. say:

selection   filter declaring rows return, formatted sql clause (excluding itself). passing null return rows given table. 

so try this:

cursor = db.query(table, c_name, new string[] {c_name + " '" + keyword + "'"}, null, null, null); 

also see answer see examples on how use selectionargs (4th argument above). keyword have go.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -