sql - Why like operator doesn't work - Sqlite -


i have query return search base operation '%srch'

 srch=search.gettext().tostring(); ... db.rawquery("select  * mytable name 'srch%' or name '%srch' ",null); 

but doesn't work.

can explain why doesn't work, , how can fix ?

thanks lot

you can fix query changing below:

db.rawquery("select * mytable name ?",             new string[] { "%" + srch + "%" }); 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -