0
Good, when doing a query:
Cursor cursor = database.rawQuery("SELECT nome, imagem, descricao FROM Marcas WHERE descricao LIKE ? OR nome LIKE ?", new String[]{name});
It only returns results through the description, that is, the second like is not tested, or does not work. It does not give any error, it does not return anything. If I shoot the second like it works both by name and by description. But what I need is to search via name and description.
How to solve?
But what I want is to pass a string and search so much in
nome
how much indescricao
. This string is a parameter when you call the method in the query.– Marceloawq
but with that the parameter passed to "rawquery(...)" does just that, i.e., search by the word "string" at any position in the Description field OR in the name field.
– Armando Marques Sobrinho
So, what I’m saying. I want to do this but it’s not working. But the query is right, I run it on sqlite expert and it works. Only on android that not.
– Marceloawq
can post more code so I can have a clearer idea?
– Armando Marques Sobrinho