I need to return a user's name in an SQLITE query: I'm using the following code:
public String verificarUsuario(String login)
{
try
{
String selectQuery = "select nome from usuarios where login = " + login;
Cursor cursor = db.rawQuery(selectQuery, null);
cursor.moveToFirst();
String nomeString = cursor.getString(cursor.getColumnIndex("tipoFunc"));
StringBuilder conversor = new StringBuilder();
conversor.append(nomeString);
return conversor.toString();
}
But the following error is appearing:
no such column: lgomes (code 1):, while compiling: select name from users where login = lgomes