sqlite - Android database useing multiple like statements -


i making search function , need search using 2 inputs:

  1. the category id (cid) string contained (or not) in key_p_cat_list (it cant done = isn't equal)

  2. the search text input (input)

i need check if category , input text contained in db record , return in cursor if so.

coloane correctly defined [] string , not problem.

my atempt:

db.query(true, p_table, coloane,key_p_cat_list + " " + " , " +cid + " like", new string[] {"%"+cid+"%", "%"+input+"%"}, null, null, null, null);

try this:

db.query(true, p_table, coloane,key_p_cat_list + " ?" + " , " +cid + " ?", new string[] {"%"+cid+"%", "%"+input+"%"}, null, null, null, null); 

hope helps!!


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -