samedi 6 février 2016

Cause error in Sqlite in android in where condition

I want to read category id from men's wear from table category so i write query like this.

String q = "SELECT " + MENU_CAT_ID + " FROM " + CATEGORY_TABLE + " WHERE " + MENU_NAME + " = '" + name + "'";

but i got an error

android.database.sqlite.SQLiteException: near "s": syntax error (code 1): , while compiling: SELECT menu_cat_id FROM category_table WHERE menu_name = 'Men's  Wear'

what can i do this case?

Aucun commentaire:

Enregistrer un commentaire