Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Query problem of SQLite in Android Studio?
Query problem of SQLite in Android Studio?
The method provided by sqliteDatabase is not practical, so I suggest that the landlord write his own SQL statement, and the parameters can be passed at will.

For example: cursor c = db.rawquery ("select * from user where username =? And the password =? ”,

New Stirling [] {"username "," password " });

If you must call the query method of SQLiteDatabase, you can do so.

Db.query ("table name", new string [] {"field 1, field 2"}," condition 1=? And condition 2=? ",new String[]{" value of condition 1, value of condition 2 "}, null, null, null)