I have a simple question : I'm new to sql so i have this question :
The below method works if names is a number. How to write this query if names is a string?
ourDatabase.update(DATABASE_TABLE, cv , KEY_NAME + "=" + names, null);
String literals in SQL are quoted in 'single quotes'.
Though it's preferable to use ? literal placeholders and bind arguments here, e.g.
ourDatabase.update(DATABASE_TABLE, cv, KEY_NAME + "=?", new String[]{names} );
KEY_NAME + "=" + ? to KEY_NAME + "=?"" - added by @Ȃŵåiṩĸîŋg edit.