android - SELECT WHERE sql query -


i'm trying match username , password in existing database , i'm stuck @ point in writing sql query.

cursor cursor = db.rawquery("select " + dbh.name + dbh.pass + " tablename where" +dbh.name +"="+ e1.gettext().tostring()+";", null); 

you can using follows highly discouraged:

string selectquery = "select * "+ table_name +" "+column_username + " = '"+usrname+"' , "+column_passwd+" = '"+passwd+"' ";  //column_username column name stores username column_passwd column storing password cursor cursor = database.rawquery(selectquery, null); 

you can try use accountmanager class purpose. there questions deal how store username , passwords. should checkout following threads:

1) android: storing username , password?

2) is safe store username + passwords in local sqlite db in android?

hope helps.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -