Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
androidsqlite更新语句_Android_Sqlite_Sql Update - Fatal编程技术网

androidsqlite更新语句

androidsqlite更新语句,android,sqlite,sql-update,Android,Sqlite,Sql Update,我正在尝试更新单行中的单个属性。然而,我下面的代码正在用“newdescription”值更新每一行 public void editSingleLocation(String id, String new_description){ SQLiteDatabase db = this.getWritableDatabase(); ContentValues newValues = new ContentValues(); newValues.p

我正在尝试更新单行中的单个属性。然而,我下面的代码正在用“newdescription”值更新每一行

public void editSingleLocation(String id, String new_description){
        SQLiteDatabase db = this.getWritableDatabase();
         ContentValues newValues = new ContentValues();
         newValues.put(COLUMN_DESCRIPTION, new_description);
         db.update(TABLE_LOCATIONS, newValues, KEY_ID=id, null);
我试图使用这个链接中的一个解决方案

但它似乎不起作用。

修复了它:

问题在于“KEY_ID=ID”;需要将其更改为:

 db.update(TABLE_LOCATIONS, newValues, KEY_ID+"="+id, null);

对不起,我的错。它看起来像是属于问题的信息(在编辑之前更是如此)。