Name holobby
Tom football
Peter basketball
What should we do if we want to find a row of data that interests football? I found a lot of methods on the Internet, but I couldn't find any idea. So I wasted a lot of time. Fortunately, I finally solved the problem. The solution is as follows:
[Java]
CopyCodeThe Code is as follows: cursor mcursor = msqlitedatabase. Query (tablename, new string [] {"ID as _ id", "name", "holobby"}, "holobby =? ", New string [] {hobbyinput}, null );
Cursor mcursor = msqlitedatabase. Query (tablename, new string [] {"ID as _ id", "name", "holobby"}, "holobby =? ", New string [] {hobbyinput}, null );
This is a simple sentence for such a statement. Many people on the Internet do not write it correctly. Note that hobbyinput is a variable and can be written as football or basketball, or a form parameter you have defined.