SQLite通过一个变量传递的值查找该列的另一个特定的值

a1768428703 2016-11-17 10:13:17
Cursor cursor=sdb.query("info", null, null,null, null, null, null);
if (cursor.getCount() > 0 && cursor != null) {
while(cursor.moveToNext()){
//name在第1列,第0列是一个自增的 _id,第三列是phone
String user=cursor.getString(1) ;
if(et1.getText().toString().trim().equals(name)){ //查找到一个name
//下面的代码是通过已查到的name值去查该行的特定值phone,并赋值给tel用来显示,写了好几个都错了





e2t.setText(user+tel);
}

...全文
107 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

80,349

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧