Sqlite how to get string items using cursor

前端 未结 5 1839
鱼传尺愫
鱼传尺愫 2020-12-18 06:38
public Cursor getImages(long rowId) throws SQLException
    {
        Cursor mCursor =
                db.rawQuery(\"select * from Pictures WHERE id=\" + rowId + \";         


        
5条回答
  •  独厮守ぢ
    2020-12-18 07:06

    Cursor c = db.rawQuery("select username from user_information where username ='" + username_txt.getText() + "'", null);
    c.moveToFirst();
    if (c.moveToFirst()) {
        username = c.getString(c.getColumnIndex("username"));
    }
    

    Use this. I hope it helps you.

提交回复
热议问题