android & sqlite - Query a single item -
I'm calling a method to see if there is a value within the database or not.
string [] column = {table.NAME}; String [] selections = {name}; Cursor cursor = db.query (table.TABLE_NAME, column, table. Name + "=?", Selection ARGS, blank, empty, empty, blank); Int index = cursor.getColumnIndex (table.ID); Whether the name exists or does not always index -1?
Whether the name exists or does not always index -1?
Because you have not included the column in table.ID .
getColumnIndex
Comments
Post a Comment