SQLite select field if text inside contains a specific text entered by user

问题内容:

my project requires that the user could search for a product by its name
so i have to select all records which contain a specific word(which the user has entered)
i was trying “select Name from Products where Name Like ‘%” + keyword + “%'”
but i didn’t work
any solution ?

问题评论:

    
Define “didn’t work” what are you getting as result?
    
tutorialspoint.com/sqlite/sqlite_like_clause.htm your like string is wrong. it should be '%keyword%'

原文地址:

https://stackoverflow.com/questions/47756379/sqlite-select-field-if-text-inside-contains-a-specific-text-entered-by-user

添加评论