How to update my string value into database

前端 未结 5 1746
粉色の甜心
粉色の甜心 2021-01-03 18:59

Have a database with table name status and column name is column1. I need to update this.

I have a String value in Activity1 <

5条回答
  •  北海茫月
    2021-01-03 19:16

    rawQuery() doesn't actually run the SQL. Use execSQL() instead:

    db.execSQL("update status SET column1 = '"+prms+"' ");
    

    (See What is the correct way to do inserts/updates/deletes in Android SQLiteDatabase using a query string? to learn more how rawQuery() and execSQL() work under the hood.)

提交回复
热议问题