android.database.sqlite.SQLiteException: no such column: aaa (code 1): , while compiling: DELETE FROM users WHERE user_name=aaa解决办法

时间:2023-01-17 23:01:14

在写安卓登录注册时注销按钮闪退发现:

android.database.sqlite.SQLiteException: no such column: aaa (code 1): , while compiling: DELETE FROM users WHERE user_name=aaa解决办法

 

这是因为此处错误:

android.database.sqlite.SQLiteException: no such column: aaa (code 1): , while compiling: DELETE FROM users WHERE user_name=aaa解决办法

 

 因为用户名为字符串,不是整型,数据库查询要引号,少了引号查询不了,导致闪退

解决后成功运行

正确用法:

android.database.sqlite.SQLiteException: no such column: aaa (code 1): , while compiling: DELETE FROM users WHERE user_name=aaa解决办法

 

 下次谨记,细节决定成败呀!